-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Material: Move WebGLRenderer.refreshUniforms() to Material.onRefreshUniforms() #18068
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Yay! Make the renderer material-agnostic. User-created materials should be able to to use this feature, too. |
|
I'm not a big fan of leaking WebGL into the scene graph... |
Hmm, I think that this approach is similar at Anyway there are other approaches in mind that I would like to try before it can be merger...
I think that yes, for this is necessary index the uniform properties on WebGPURenderer. |
I can only agree. Better to encapsulate WebGL related logic in the renderer classes. |
For exception of properties parameter, the logic is the same of I think that |
|
|
|
We can consider a different approach to this case? Maybe var UniformsLib = {
common: {
diffuse: { value: new Color( 0xeeeeee ) },
onUpdate: function( uniforms, material ) {
uniforms.diffuse.value.copy( material.color );
}
}
} |
The mainly idea is get more control about the uniforms update in materials, mainly related with core materials. using an interface native in material:
Material.onRefreshUniforms.Benefits:
Material.onRefreshUniformsif elserelated with the code.Call example:
MeshPhysicalMaterial->onRefreshUniforms()->MeshStandardMaterial->onRefreshUniforms()->Material->onRefreshUniforms()