Skip to content

Shaders freeze when changing uniforms with react-dat-gui #1080

Answered by aliiscript
aliiscript asked this question in Q&A
Discussion options

You must be logged in to vote

Solved it! Not sure how to close this,but If anyone runs into a similar problem--I passed my props that are manipulated by react-dat-gui straight into the mesh, using a ref, like bruno did instead of changing the uniforms object directly:
if (shaderMaterialRef.current) { shaderMaterialRef.current.uniforms.uFrequency.value = new THREE.Vector2( props.uFrequencyX, props.uFrequencyY ); }
message me if you this wasnt clear 🙏

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@gsimone
Comment options

Answer selected by aliiscript
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants