I’m working on a project that shows a room in 360 degrees that you can orbit, the room has a 360 degrees videoTexture.
However, before the video is loading, I want to use a screen fill that is displayed until the video is done loading.
It works, but there is a side effect which I can’t wrap my head around.
When the videoTexture replaces the screen fill it’s been Over brightened and noisy, it looks like it’s overlaying the videoTexture with the previous screen fill.
Has anyone any idea what goes wrong, do I need to dispose or clear the texture and if so, how I do this?
i don’t think that’s your issue but useMemo is for memoized calculations, not side effects. by rec-creating the video on every flag change and adding listeners you already have race conditions. side effects always go into useEffect, and if you have a listener, make sure to clean up, too.
i have no idea what i’m looking at, i just see a plant. if you want make a very reduced 50 lines max codesandbox to show the problem i can perhaps help.
ps “overexposure” sounds like tonemapping and encoding to me. the video texture should have encoding={THREE.sRGBEncoding} and the material toneMapped={false}. this is how you use video textures: Video textures - CodeSandbox
that’s not how suspense works im afraid. can you give me a description which events i need to listen to, i dont know how to use the doms video tag. i can build that hook. as for graininess - that seems unrelated to me. what has react, hooks, suspense, fiber, threejs to do with grain in a video texture.