You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to update the colors programatically frame by frame without using state for performance reasons, and it seems like I can't access uniforms of the material. It seems like I can't access the getters and setters of the shaderMaterial as well.
three.current?.scene.traverse(function(object){if(objectinstanceofMesh&&object.materialinstanceofMeshPhysicalMaterial){object.material.userData.colors=["#0000FF","#00FF00","#000000"];object.material.needsUpdate=true;constshaderMaterial=object.materialasunknownasShaderMaterial&{colors: Color[];};console.log(shaderMaterial);console.log(shaderMaterial.colors);// this throws an errorconsole.log(shaderMaterial.uniforms);// this throws an error}});
The text was updated successfully, but these errors were encountered:
I am trying to update the colors programatically frame by frame without using state for performance reasons, and it seems like I can't access
uniforms
of the material. It seems like I can't access the getters and setters of the shaderMaterial as well.https://github.com/ruucm/shadergradient/blob/650f8e14581bbbc69171333af01a165ee477ddaa/packages/shadergradient/src/Gradient/comps/Mesh/shaderMaterial.ts#L70C5-L70C5
Any pointers would be greatly appreciated!
Here are my efforts below without any luck
The text was updated successfully, but these errors were encountered: