` which casts a shadow. When navigating away from the page with the scene and navigating back to the scene (using NuxtLink), I get the error below.\r\n\r\nWhen I remove the `cast-shadow` prop, the bug disappears.\r\n\r\n\r\n```\r\nthree.js?v=f17f74c8:17801 Uncaught TypeError: Cannot read properties of null (reading 'state')\r\n at setProgram (three.js?v=f17f74c8:17801:41)\r\n at WebGLRenderer.renderBufferDirect (three.js?v=f17f74c8:17292:23)\r\n at renderObject (three.js?v=f17f74c8:13624:21)\r\n at renderObject (three.js?v=f17f74c8:13631:7)\r\n at WebGLShadowMap.render (three.js?v=f17f74c8:13519:9)\r\n at WebGLRenderer.render (three.js?v=f17f74c8:17493:17)\r\n at tres.js:387:33\r\n at index.mjs:71:52\r\n at Array.map (\u003Canonymous>)\r\n at Object.trigger (index.mjs:71:40)\r\n ```\r\n \u003Cdetails>\r\n \u003Csummary>complete error log\u003C/summary>\r\n\r\n ```\r\nsetProgram\t\t\t\t@\tthree.js?v=f17f74c8:17801\r\nWebGLRenderer.renderBufferDirect\t@\tthree.js?v=f17f74c8:17292\r\nrenderObject\t\t\t\t@\tthree.js?v=f17f74c8:13624\r\nrenderObject\t\t\t\t@\tthree.js?v=f17f74c8:13631\r\nWebGLShadowMap.render\t\t\t@\tthree.js?v=f17f74c8:13519\r\nWebGLRenderer.render\t\t\t@\tthree.js?v=f17f74c8:17493\r\n(anonymous)\t\t\t\t@\ttres.js:387\r\n(anonymous)\t\t\t\t@\tindex.mjs:71\r\ntrigger\t\t\t\t\t@\tindex.mjs:71\r\nwe.immediate\t\t\t\t@\ttres.js:160\r\nloop\t\t\t\t\t@\tindex.mjs:617\r\nrequestAnimationFrame\t\t\r\nresume\t\t\t\t\t@\tindex.mjs:624\r\nor\t\t\t\t\t@\ttres.js:388\r\ncr\t\t\t\t\t@\ttres.js:593\r\n(anonymous)\t\t\t\t@\ttres.js:1086\r\n(anonymous)\t\t\t\t@\truntime-core.esm-bundler.js:2757\r\ncallWithErrorHandling\t\t\t@\truntime-core.esm-bundler.js:199\r\ncallWithAsyncErrorHandling\t\t@\truntime-core.esm-bundler.js:206\r\nhook.__weh.hook.__weh\t\t\t@\truntime-core.esm-bundler.js:2737\r\nflushPostFlushCbs\t\t\t@\truntime-core.esm-bundler.js:385\r\nflushJobs\t\t\t\t@\truntime-core.esm-bundler.js:427\r\nPromise.then\t\t\r\nqueueFlush\t\t\t\t@\truntime-core.esm-bundler.js:322\r\nqueuePostFlushCb\t\t\t@\truntime-core.esm-bundler.js:336\r\nqueueEffectWithSuspense\t\t\t@\truntime-core.esm-bundler.js:7256\r\nbaseWatchOptions.scheduler\t\t@\truntime-core.esm-bundler.js:6138\r\neffect2.scheduler\t\t\t@\treactivity.esm-bundler.js:1892\r\ntrigger\t\t\t\t\t@\treactivity.esm-bundler.js:250\r\nendBatch\t\t\t\t@\treactivity.esm-bundler.js:308\r\nnotify\t\t\t\t\t@\treactivity.esm-bundler.js:594\r\ntrigger\t\t\t\t\t@\treactivity.esm-bundler.js:568\r\nset value\t\t\t\t@\treactivity.esm-bundler.js:1510\r\nfinalizeNavigation\t\t\t@\tvue-router.mjs:3478\r\n(anonymous)\t\t\t\t@\tvue-router.mjs:3343\r\nPromise.then\t\t\r\npushWithRedirect\t\t\t@\tvue-router.mjs:3310\r\npush\t\t\t\t\t@\tvue-router.mjs:3235\r\nnavigate\t\t\t\t@\tvue-router.mjs:2300\r\ncallWithErrorHandling\t\t\t@\truntime-core.esm-bundler.js:199\r\ncallWithAsyncErrorHandling\t\t@\truntime-core.esm-bundler.js:206\r\ninvoker\t\t\t\t\t@\truntime-dom.esm-bundler.js:722\r\n```\r\n\u003C/details>\n\n### Reproduction\n\nhttps://stackblitz.com/edit/nuxt-starter-w3neca?file=pages%2Findex.vue\n\n### Steps to reproduce\n\n_No response_\n\n### System Info\n\n```shell\nSystem:\r\n OS: macOS 14.6.1\r\n CPU: (10) arm64 Apple M1 Pro\r\n Memory: 79.77 MB / 32.00 GB\r\n Shell: 5.9 - /bin/zsh\r\n Binaries:\r\n Node: 20.9.0 - ~/.nvm/versions/node/v20.9.0/bin/node\r\n Yarn: 1.22.19 - /opt/homebrew/bin/yarn\r\n npm: 10.1.0 - ~/.nvm/versions/node/v20.9.0/bin/npm\r\n pnpm: 9.4.0 - ~/Library/pnpm/pnpm\r\n bun: 1.0.3 - ~/.bun/bin/bun\r\n Browsers:\r\n Chrome: 129.0.6668.100\r\n Safari: 17.6\r\n npmPackages:\r\n @tresjs/cientos: ^4.0.3 => 4.0.2 \r\n @tresjs/core: ^4.2.10 => 4.2.10 \r\n @tresjs/nuxt: ^3.0.7 => 3.0.7\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.",[2886],{"name":2887,"color":2888},"pending-triage","97A4FE",851,"tres","Scene breaks when `cast-shadow` enabled and navigating back to a previously initialized scene","2024-10-22T15:09:42Z","https://github.com/Tresjs/tres/issues/851",0.71178865,{"description":2896,"labels":2897,"number":2899,"owner":2863,"repository":2864,"state":2865,"title":2900,"updated_at":2901,"url":2902,"score":2903},"### Description\r\n\r\nAs a Tres dev, I'd sometimes like to show off Tres/Cientos on mobile. But when the docs demos include Leches controls, the Leches controls mostly cover the demo visuals.\r\n\r\n[From Lensflare](https://deploy-preview-272--cientos-tresjs.netlify.app/guide/abstractions/lensflare.html):\r\n\r\n\u003Cimg width=\"322\" alt=\"Screenshot 2023-10-29 at 22 33 56\" src=\"https://github.com/Tresjs/cientos/assets/20469369/55599767-0d8d-456e-b681-810a37a270f3\">\r\n\r\n### Suggested solution\r\n\r\nI suggest that we extend Leches controls so that they can be embedded in the page below the demos. See highlighted area:\r\n\r\n\u003Cimg width=\"318\" alt=\"Screenshot 2023-10-29 at 22 41 46\" src=\"https://github.com/Tresjs/cientos/assets/20469369/1004d966-1e28-4776-b132-0e2c42255244\">\r\n\r\n### Additional requirements\r\n\r\n* the controls would be inserted into the [normal document flow](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Normal_Flow), so that they don't overlap other content\r\n* the controls' styling would reflect the dark/light theme choices of the user\r\n\r\n\r\n### Alternative\r\n\r\nLeave as is.\r\n\r\n### Validations\r\n\r\n- [X] I agree to follow this project's [Code of Conduct](https://github.com/Tresjs/cientos/blob/main/CODE_OF_CONDUCT.md)\r\n- [X] Read the [Contributing Guidelines](https://github.com/Tresjs/cientos/blob/main/CONTRIBUTING.md).\r\n- [X] Read the [docs](https://cientos.tresjs.org/guide).\r\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.",[2898],{"name":2860,"color":2861},273,"Embed Leches controls under docs demos","2024-04-02T07:13:11Z","https://github.com/Tresjs/cientos/issues/273",0.7209667,{"description":2905,"labels":2906,"number":2910,"owner":2863,"repository":2864,"state":2865,"title":2911,"updated_at":2912,"url":2913,"score":2914},"### Description\n\nAs a developer using Tres I would like to have different level of detailed mesh depending on the distance of the camera.\r\n\r\nThreeJs provide us with [LOD](https://threejs.org/docs/index.html?q=LOD#api/en/objects/LOD). Which we can easily adapt it\n\n### Suggested solution\n\nCould be based on: https://github.com/pmndrs/drei#detailed\r\n\r\n\u003CTresDetailed :args=\"[0, 10, 20]\">\r\n \u003CTresMesh name=\"highPoly\" />\r\n \u003CTresMesh name=\"mediumPoly\" />\r\n \u003CTresMesh name=\"lowPoly\" />\r\n\u003CTresDetailed>\r\n\r\nOther alternatives are considered (I believe we can be a little more intuitive attaching the mesh directly and no by position)\n\n### Alternative\n\nAlso, it could be a composable like useLevelOfDetail \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/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.",[2907],{"name":2908,"color":2909},"p2-nice-to-have","D4C5F9",393,"\u003CLOD />","2024-11-18T19:17:38Z","https://github.com/Tresjs/cientos/issues/393",0.7235698,{"description":2916,"labels":2917,"number":2927,"owner":2863,"repository":2864,"state":2865,"title":2928,"updated_at":2929,"url":2930,"score":2931},"### Description\n\nWould be awesome if there was arc ball controls added to tres\r\n\r\nThis control method is ideal for industrial applications (like CAD) and is what most engineers expect coming from software like solidworks, onshape, or fusion 360.\r\n\r\n\r\n\r\n\n\n### Suggested solution\n\nhttps://threejs.org/examples/misc_controls_arcball.html\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/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.",[2918,2921,2924],{"name":2919,"color":2920},"good first issue","7057ff",{"name":2922,"color":2923},"feature","c2e0c6",{"name":2925,"color":2926},"PR Welcome","2D76B0",490,"Arcball controlls helper","2024-09-12T19:58:43Z","https://github.com/Tresjs/cientos/issues/490",0.7338158,{"description":2933,"labels":2934,"number":2936,"owner":2863,"repository":2937,"state":2938,"title":2939,"updated_at":2940,"url":2941,"score":2942},"**Describe the bug**\r\nFor some reason the dof and outline effect demos got broken.\r\n\r\n**Reproduction**\r\ncheck docs\r\n",[2935],{"name":2857,"color":2858},67,"post-processing","closed","depth of field and outline effect docs are broken","2025-03-09T17:05:23Z","https://github.com/Tresjs/post-processing/issues/67",0.6597139,{"description":2944,"labels":2945,"number":2877,"owner":2863,"repository":2864,"state":2938,"title":2947,"updated_at":2948,"url":2949,"score":2882},"### Description\n\nAs a Developer using TresJS I would like to have a composable `useFBO` that leverages the effort of creating a `THREE.WebGLRenderTarget` \r\n\r\n```\r\nconst target = useFBO({ stencilBuffer: false })\r\n\r\n```\r\n\r\nDrei's\r\nhttps://github.com/pmndrs/drei/blob/master/src/core/useFBO.tsx\r\n\r\nReference:\r\nhttps://github.com/pmndrs/drei/tree/master#usefbo\r\n\r\n\n\n### Suggested solution\n\nImplement a composable that accepts:\r\n\r\n- `width`\r\n- `height`/\r\n- `samples` // Defines the count of MSAA samples. Can only be used with WebGL 2. Default: 0 \r\n- `depth` // If set, the scene depth will be rendered into buffer.depthTexture. Default: false\r\n\r\nAnd returns the renderTarget, The rendertarget should be automatically disposed when unmounted.\r\n\r\n\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/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.",[2946],{"name":2919,"color":2920},"useFBO abstraction","2023-10-07T14:07:10Z","https://github.com/Tresjs/cientos/issues/149",{"description":2951,"labels":2952,"number":2953,"owner":2863,"repository":2890,"state":2938,"title":2954,"updated_at":2955,"url":2956,"score":2957},"### Description\r\n\r\nBased on https://github.com/orgs/Tresjs/discussions/321\r\n\r\nAs a plugin author, I will like to have a reactive state with the following characteristics:\r\n\r\n- Performant, (use of `shallowRef` where needed)\r\n- read-only\r\n- Strictly Typed\r\n- Reduce side effects on watchers\r\n- Needs to work on cientos and the rest of ecosystem via `provide/inject` \r\n\r\n### Suggested solution\r\n\r\n| Name | Type | Requirement | Details |\r\n| ---------------------------------- | -------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\r\n| scene | readonly, shallowRef | essential | |\r\n| cameras | readonly, shallowRef | essential | userData.TRES_IS_ACTIVE_CAMERA = true\u003Cbr>const cameras = shallowRef([]) return { cameras: readonly(cameras)} |\r\n| camera | computed, readonly | essential | |\r\n| pushCamera(newCamera: Camera, setActive: boolean) | function | essential | cameras should be watched and removed from the cameras array if they got removed from the scene |\r\n| removeCamera(camera: Camera) | function | essential ||\r\n| setCamera(cameraId string) | function | essential ||\r\n| renderer | readonly, shallowRef | essential | setRenderer(renderer: Renderer)\u003Cbr>maybe only callable once? |\r\n| setRenderer(renderer: Renderer) | function | essential ||\r\n| sizes (height, width, aspectRatio) | readonly | handy | sizes: {\u003Cbr> height: Ref\u003Cnumber>\u003Cbr> width: Ref\u003Cnumber>\u003Cbr> aspectRatio: Computed\u003Cnumber>\u003Cbr>} |\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.",[],331,"New and better state context provider","2023-07-29T08:58:56Z","https://github.com/Tresjs/tres/issues/331",0.6974998,{"description":2959,"labels":2960,"number":2967,"owner":2863,"repository":2890,"state":2938,"title":2968,"updated_at":2969,"url":2970,"score":2971},"### Describe the bug\n\nIt seems like Tres.js is no longer working in Firefox. Even on your official documentation all examles render just a black canvas.\r\nI would really like to use Tres.js in projects of my company, but I am unable to do this if Firefox is not supported or working :(\n\n### Reproduction\n\nhttps://tresjs.org/guide/\n\n### Steps to reproduce\n\nThe first and all other examples of this page.\n\n### System Info\n\n```shell\nWindows 10\r\nFirerfiox version 114.0.1 (64-Bit)\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.",[2961,2964],{"name":2962,"color":2963},"question","d876e3",{"name":2965,"color":2966},"waiting for author","B145BC",310,"Black Canvas in Firefox","2023-06-20T07:13:04Z","https://github.com/Tresjs/tres/issues/310",0.7056556,["Reactive",2973],{},["Set"],["ShallowReactive",2976],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$f2dX-ojbBhJVS3T5ooECXkAUF5vO6hwnRQMLdo2RxdU8":-1},"/Tresjs/cientos/210"]