` currently only accepts 1 string flag from the user. Using only flags means the system relies solely on us predicting users' needs and implementing a \"mode\" for them.\r\nAccepting only a single flag means we can't have a compound policy, e.g., \"rerender if advance or invalidate were called or the window resized. Afaik, this currently leads to cases where manual is the mode – the canvas will be blank if the window is resized, until invalidate is called.\r\n\r\n\r\n\r\n### Suggested solution\r\n\r\nEncapsulate the logic for \"Should the next tick update/render?\" in a module – maybe `src/core/renderPolicy.ts`?\r\nLet the render policy be specified via functions/objects as follows:\r\n\r\n```ts\r\nimport { createRenderPolicy, manual } from '...'\r\nconst policy = createRenderPolicy(manual)\r\nconst { invalidate } = policy\r\n...\r\n\u003CTresCanvas :render-policy=\"policy\" />\r\n```\r\n\r\nAbove, \r\n\r\n- manual is \"rule\" function that contains its own state, tracking if invalidate() was called since the last update.\r\n- policy is an object that relays calls to invalidate and advance to its rules, then asks the rules if the next tick should update/render or not.\r\n\r\nIn this way, we could have compound policies. E.g.,\r\n\r\n```ts\r\n// NOTE: This policy will approve the next tick of jobs if ...\r\n// - `invalidate()` was called\r\n// - the window was resized\r\n// but cancel if ...\r\n// - the canvas is off-screen\r\nconst { shouldUpdate, invalidate } = createRenderPolicy([manual, windowResize, cancelIfOffScreen])\r\nshouldUpdate() // false\r\ninvalidate()\r\nshouldUpdate() // true\r\n```\r\n\r\nRules would be evaluated in FILO order, with the result of lower ranking rules being passed to higher ranking rules, so this ...\r\n\r\n```\r\ncreateRenderPolicy([manual, cancelIfOffScreen, windowResize])\r\n```\r\n\r\n... cancels true from windowResize if the canvas is offscreen. But if the canvas is off-screen, manual's advance(n) will still take precedence.\r\n\r\nWhereas here ...\r\n\r\n```\r\ncreateRenderPolicy([cancelIfOffScreen, manual, windowResize])\r\n```\r\n\r\n... `cancelIfOffScreen` takes precedence over the other 2 rules and cancels both if the canvas is off-screen. \r\n----\r\n\r\nRules are relatively simple to write and users could supply their own rules, if we surface that in the API. Here's a \"complicated\" rule – `windowResize` – in its current form:\r\n\r\n```ts\r\nexport const windowResize: CreateUpdateRule = () => {\r\n let invalidated = true\r\n const invalidate = () => { invalidated = true }\r\n window.addEventListener('resize', invalidate)\r\n return {\r\n shouldUpdate: (lowRankResult: boolean) => {\r\n const result = invalidated\r\n invalidated = false\r\n return result || lowRankResult\r\n },\r\n dispose: () => {\r\n window.removeEventListener('resize', invalidate)\r\n }\r\n }\r\n}\r\n```\r\nHere's manual:\r\n\r\n```ts\r\nexport const manual: CreateUpdateRule = () => {\r\n let numFramesToAdvance = 0\r\n return {\r\n advance: (numFrames = 1) => {\r\n numFramesToAdvance = Math.max(numFramesToAdvance, numFrames)\r\n },\r\n shouldUpdate: (lowRankResult: boolean) => {\r\n const result = numFramesToAdvance > 0\r\n numFramesToAdvance = Math.max(0, numFramesToAdvance - 1)\r\n return result || lowRankResult\r\n }\r\n }\r\n}\r\n```\r\n\r\n### Alternative\r\n\r\n_No response_\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Validations\r\n\r\n- [X] I agree to follow this project's [Code of Conduct](https://github.com/Tresjs/tres/blob/main/CODE_OF_CONDUCT.md)\r\n- [X] Read the [Contributing Guidelines](https://github.com/Tresjs/tres/blob/main/CONTRIBUTING.md).\r\n- [X] Read the [docs](https://tresjs.org/guide).\r\n- [X] Check that there isn't [already an issue](https://github.com/tresjs/tres/issues) that reports the same bug to avoid creating a duplicate.\r\n\r\nEdit (andretchen0): fixed formatting ",[2879,2882],{"name":2880,"color":2881},"feature","c2e0c6",{"name":2883,"color":2884},"pending-triage","97A4FE",689,"tres","Render mode policies","2024-05-24T14:21:03Z","https://github.com/Tresjs/tres/issues/689",0.78346217,{"description":2892,"labels":2893,"number":2897,"owner":2869,"repository":2886,"state":2871,"title":2898,"updated_at":2899,"url":2900,"score":2901},"### Describe the bug\n\nusing three-viewport-gizmo (https://www.npmjs.com/package/three-viewport-gizmo) after 'const gizmo = new ViewportGizmo(camera, renderer);', a white screen is triggered and the canvas is cleared\n\n### Reproduction\n\nno\n\n### Steps to reproduce\n\n_No response_\n\n### System Info\n\n_No response_\n\n### Used Package Manager\n\npnpm\n\n### Code of Conduct\n\n- [X] I agree to follow this project's [Code of Conduct](https://github.com/Tresjs/tres/blob/main/CODE_OF_CONDUCT.md)\n- [X] Read the [Contributing Guidelines](https://github.com/Tresjs/tres/blob/main/CONTRIBUTING.md).\n- [X] Read the [docs](https://tresjs.org/guide).\n- [X] Check that there isn't [already an issue](https://github.com/tresjs/tres/issues) that reports the same bug to avoid creating a duplicate.\n- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.",[2894],{"name":2895,"color":2896},"needs reproduction","511ECF",879,"using three-viewport-gizmo will clear the canvas","2024-12-06T04:38:37Z","https://github.com/Tresjs/tres/issues/879",0.78434837,{"description":2903,"labels":2904,"number":2908,"owner":2869,"repository":2886,"state":2909,"title":2910,"updated_at":2911,"url":2912,"score":2913},"**Describe the bug**\r\nThe library still glitches in responsiveness, especially regarding models, they get distorted aspect ratio, probably the canvas.\r\n\r\n**Reproduction**\r\nRe-scale a scene\r\n\r\n\r\n**Steps**\r\nSteps to reproduce the behavior:\r\n1. Go to any scene\r\n2. Resize until very very small\r\n\r\n**Expected behavior**\r\nRe-scaling doesn't affect objects or the camera aspect ratio\r\n\r\n**Screenshots**\r\n\r\n\r\n\r\n**System Info**\r\nOutput of `npx envinfo --system --npmPackages '{vite,@tresjs/*, three, vue}' --binaries --browsers` \r\n\r\n```\r\n System:\r\n OS: macOS 13.2.1\r\n CPU: (8) arm64 Apple M1 Pro\r\n Memory: 74.72 MB / 16.00 GB\r\n Shell: 5.8.1 - /bin/zsh\r\n Binaries:\r\n Node: 18.14.1 - ~/.nvm/versions/node/v18.14.1/bin/node\r\n Yarn: 1.22.19 - /usr/local/bin/yarn\r\n npm: 9.3.1 - ~/.nvm/versions/node/v18.14.1/bin/npm\r\n Browsers:\r\n Brave Browser: 110.1.48.164\r\n Chrome: 110.0.5481.177\r\n Safari: 16.3\r\n npmPackages:\r\n @tresjs/cientos: ^1.7.0 => 1.7.0 \r\n @tresjs/core: ^1.7.0 => 1.7.0 \r\n vite: ^4.1.0 => 4.1.4 \r\n```\r\n\r\n**Additional context**\r\nAdd any other context about the problem here.\r\n",[2905],{"name":2906,"color":2907},"bug","d73a4a",127,"closed","Scene doesn't scale properly","2023-02-27T19:56:06Z","https://github.com/Tresjs/tres/issues/127",0.7767055,{"description":2915,"labels":2916,"number":2868,"owner":2869,"repository":2921,"state":2909,"title":2922,"updated_at":2923,"url":2924,"score":2875},"### Description\n\nI would like to have some demos in this repo, applying basic forces \n\n### Suggested solution\n\n_No response_\n\n### Alternative\n\n_No response_\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] I agree to follow this project's [Code of Conduct](https://github.com/Tresjs/rapier/blob/main/CODE_OF_CONDUCT.md)\n- [X] Read the [Contributing Guidelines](https://github.com/Tresjs/rapier/blob/main/CONTRIBUTING.md).\n- [X] Read the [docs](https://rapier.tresjs.org/guide).\n- [X] Check that there isn't [already an issue](https://github.com/tresjs/rapier/issues) that reports the same bug to avoid creating a duplicate.",[2917,2920],{"name":2918,"color":2919},"good first issue","7057ff",{"name":2880,"color":2881},"rapier","Demos: apply forces","2024-09-12T13:49:59Z","https://github.com/Tresjs/rapier/issues/104",{"description":2926,"labels":2927,"number":2934,"owner":2869,"repository":2935,"state":2909,"title":2936,"updated_at":2937,"url":2938,"score":2939},"### Describe the bug\n\nThere is a discrepancy between the documentation and the implementation regarding the default value of the enableDamping property in OrbitControls. The documentation states that enableDamping should be false by default, but in the code, it is set to true.\r\n[Line 237](https://github.com/Tresjs/cientos/blob/981de572c97183b8d2070925daa8209d2fa6b55e/src/core/controls/OrbitControls.vue#L237)\n\n### Reproduction\n\nhttps://stackblitz.com/edit/tresjs-basic-ldqdkm?file=src%2Fcomponents%2FTheExperience.vue\n\n### Steps to reproduce\n\nJust use OrbitControls with default arguments. \n\n### System Info\n\n_No response_\n\n### Used Package Manager\n\nnpm\n\n### Code of Conduct\n\n- [X] I agree to follow this project's [Code of Conduct](https://github.com/Tresjs/cientos/blob/main/CODE_OF_CONDUCT.md)\n- [X] Read the [Contributing Guidelines](https://github.com/Tresjs/cientos/blob/main/CONTRIBUTING.md).\n- [X] Read the [docs](https://cientos.tresjs.org/guide).\n- [X] Check that there isn't [already an issue](https://github.com/Tresjs/cientos/issues) that reports the same bug to avoid creating a duplicate.\n- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.",[2928,2931],{"name":2929,"color":2930},"p1-chore","BFD4F2",{"name":2932,"color":2933},"PR Welcome","2D76B0",447,"cientos","Discrepancy Between Documentation and Default Value for enableDamping in OrbitControls","2024-09-08T10:33:25Z","https://github.com/Tresjs/cientos/issues/447",0.7812528,{"description":2941,"labels":2942,"number":2944,"owner":2869,"repository":2886,"state":2909,"title":2945,"updated_at":2946,"url":2947,"score":2948},"### Describe the bug\n\nThe official [Vue devtools](https://github.com/vuejs/devtools) is broken since v2. Most probably related to the edge case of the use of a custom renderer.\r\n\r\n\n\n### Reproduction\n\nhttps://stackblitz.com/edit/stackblitz-starters-sa3ruk?file=README.md\n\n### Steps to reproduce\n\nOpen in a new tab\r\nCheck dev tools\r\nCheck error in console\r\n\r\n```\r\nTypeError: Cannot read properties of undefined (reading 'ownerDocument')\r\n```\n\n### System Info\n\n_No response_\n\n### Used Package Manager\n\npnpm\n\n### Code of Conduct\n\n- [X] I agree to follow this project's [Code of Conduct](https://github.com/Tresjs/tres/blob/main/CODE_OF_CONDUCT.md)\n- [X] Read the [Contributing Guidelines](https://github.com/Tresjs/tres/blob/main/CONTRIBUTING.md).\n- [X] Read the [docs](https://tresjs.org/guide).\n- [X] Check that there isn't [already an issue](https://github.com/tresjs/tres/issues) that reports the same bug to avoid creating a duplicate.\n- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.",[2943],{"name":2906,"color":2907},317,"Vue-devtools broken since v2 custom renderer","2023-08-23T05:12:31Z","https://github.com/Tresjs/tres/issues/317",0.78409433,{"description":2950,"labels":2951,"number":2957,"owner":2869,"repository":2886,"state":2909,"title":2958,"updated_at":2959,"url":2960,"score":2961},"### Describe the bug\n\n## Problem\r\n\r\n`useRenderLoop().onLoop` ticks before the renderer can meaningfully render. \r\n\r\nWhen `onLoop` is initially called, e.g.:\r\n\r\n* camera.aspect has its default value of 1, regardless of screen aspect\r\n* renderer.domElement.width has a value of 0\r\n* sizes.width has a value of 0\r\n\r\nThese values change on the subsequent frame, making coding/debugging more difficult than necessary.\r\n\r\n## Solution\r\n\r\n* `useRenderLoop()` should be dependent on the `context`'s renderer.\r\n* The system shouldn't tick `onLoop` until the renderer is ready. \r\n\r\n## Context\r\n\r\n* #251\r\n* #252\r\n\r\n\n\n### Reproduction\n\nhttps://stackblitz.com/edit/tresjs-basic-t6zfd2?file=src%2Fcomponents%2FUseRenderer.vue\n\n### Steps to reproduce\n\nSee StackBlitz.\n\n### System Info\n\n```shell\nSystem:\r\n OS: Linux 5.0 undefined\r\n CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz\r\n Memory: 0 Bytes / 0 Bytes\r\n Shell: 1.0 - /bin/jsh\r\n Binaries:\r\n Node: 18.18.0 - /usr/local/bin/node\r\n Yarn: 1.22.19 - /usr/local/bin/yarn\r\n npm: 10.2.3 - /usr/local/bin/npm\r\n pnpm: 8.15.3 - /usr/local/bin/pnpm\r\n npmPackages:\r\n @tresjs/cientos: ^3.5.1 => 3.5.1 \r\n @tresjs/core: ^3.4.1 => 3.4.1 \r\n @tresjs/eslint-config-vue: ^0.2.1 => 0.2.1 \r\n vite: ^4.5.0 => 4.5.0\n```\n\n\n### Used Package Manager\n\nnpm\n\n### Code of Conduct\n\n- [X] I agree to follow this project's [Code of Conduct](https://github.com/Tresjs/tres/blob/main/CODE_OF_CONDUCT.md)\n- [X] Read the [Contributing Guidelines](https://github.com/Tresjs/tres/blob/main/CONTRIBUTING.md).\n- [X] Read the [docs](https://tresjs.org/guide).\n- [X] Check that there isn't [already an issue](https://github.com/tresjs/tres/issues) that reports the same bug to avoid creating a duplicate.\n- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.",[2952,2954],{"name":2953,"color":2933},"PR welcome",{"name":2955,"color":2956},"p3-minor-bug","F28C37",595,"`useRenderLoop().onLoop` ticks before the renderer can meaningfully render","2024-06-15T09:59:36Z","https://github.com/Tresjs/tres/issues/595",0.78500134,{"description":2963,"labels":2964,"number":2965,"owner":2869,"repository":2886,"state":2909,"title":2966,"updated_at":2967,"url":2968,"score":2969},"### Describe the bug\n\nThe click-event on meshes does not properly work when the scene is not shown full screen.\n\n### Reproduction\n\nhttps://stackblitz.com/edit/tresjs-basic-hjvh64?file=src%2Fcomponents%2FTheExperience.vue\n\n### Steps to reproduce\n\n_No response_\n\n### System Info\n\n_No response_\n\n### Used Package Manager\n\npnpm\n\n### Code of Conduct\n\n- [X] I agree to follow this project's [Code of Conduct](https://github.com/Tresjs/tres/blob/main/CODE_OF_CONDUCT.md)\n- [X] Read the [Contributing Guidelines](https://github.com/Tresjs/tres/blob/main/CONTRIBUTING.md).\n- [X] Read the [docs](https://tresjs.org/guide).\n- [X] Check that there isn't [already an issue](https://github.com/tresjs/tres/issues) that reports the same bug to avoid creating a duplicate.\n- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.",[],282,"Raycaster does not work properly when scene is not in full screen","2023-06-19T06:42:39Z","https://github.com/Tresjs/tres/issues/282",0.78847736,{"description":2971,"labels":2972,"number":2974,"owner":2869,"repository":2886,"state":2909,"title":2975,"updated_at":2976,"url":2977,"score":2978},"### Description\n\nAs a developer using TresJS, I would like to change reactively the constructor params via args prop, which is not possible at the moment.\r\n\r\n```ts\r\n\u003Cscript lang=\"ts\" setup>\r\n// renderer.domElement is undefined at the beginning. \r\n\u003C/script>\r\n\r\n\u003Ctemplate>\r\n \u003CTresOrbitControls :args=\"[activeCamera || camera, renderer?.domElement || domElement]\" />\r\n \u003C/template>\r\n ```\n\n### Suggested solution\n\nAdd logic to `nodeOps` to re-instance the THREE object when `args` change\n\n### Alternative\n\n_No response_\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] I agree to follow this project's [Code of Conduct](https://github.com/Tresjs/tres/blob/main/CODE_OF_CONDUCT.md)\n- [X] Read the [Contributing Guidelines](https://github.com/Tresjs/tres/blob/main/CONTRIBUTING.md).\n- [X] Read the [docs](https://tresjs.org/guide).\n- [X] Check that there isn't [already an issue](https://github.com/tresjs/tres/issues) that reports the same bug to avoid creating a duplicate.",[2973],{"name":2906,"color":2907},366,"Re-instance THREE instances via args prop reactivity","2023-08-17T13:53:39Z","https://github.com/Tresjs/tres/issues/366",0.7903859,["Reactive",2980],{},["Set"],["ShallowReactive",2983],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$f6aA96xsClGsSd1Q74EnSBzCZfPrYGuybHtHEk3lqUyY":-1},"/Tresjs/tres/765"]