Replies: 4 comments 12 replies
-
youre overwriting uniforms, thats something that threejs doesnt do: https://threejs.org/docs/#manual/en/introduction/How-to-update-things reason is a missing const uniforms = useMemo(() => ({
time: { value: 0.0 }
}), []) nice effect btw! |
Beta Was this translation helpful? Give feedback.
-
Oh, thanks! This thing was bugging me for a while :) |
Beta Was this translation helpful? Give feedback.
-
Done: pmndrs/drei#32 Also I have a custom (and extremely compact) implementation of some controls. Had to do it, cause OrbitControls was absolutely unusable with actual planetary view mainly due to constant zoom speed. Also I implemented the transition to bird-view as it gets closer to the planet. Check it out here: |
Beta Was this translation helpful? Give feedback.
-
awesome, thanks, i've added a few options. had to make a slight adjustment to the shader code because bigger size would speed up the pulse, not sure if correct but looks ok to me. as for the controls, do you have the source somewhere? looks very nice indeed. |
Beta Was this translation helpful? Give feedback.
-
I'm new to 3d and cannot quite figure this out on my own. Basically what happens, is that update to some state irrelevant to the component (Stars) triggers its re-render which somehow disrupts render loop and updates to uniforms are not coming through anymore. I created a codesandbox representing the problem (clicking on a white box breaks stars blinking): https://codesandbox.io/s/shaderanimation-27n74?file=/src/index.js
Can anyone help figure out what am I doing wrong? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions