-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
Update Shader and UniformsUtils #719
Conversation
Don't worry about the |
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
import { IUniform } from './UniformsLib.js'; | ||
|
||
export interface Shader { | ||
export interface Shader extends WebGLProgramParameters { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I rename Shader
to WebGLProgramParametersWithUniforms
? I think Shader
works too as a parameter type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was actually thinking we'd keep Shader
as-is, since it's really just intended to describe the type of shaders in ShaderLib
. Maybe it should be renamed to ShaderLibShader
to make that more clear? I was thinking we'd export a WebGLProgramParametersWithUniforms
interface from WebGLRenderer
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've exported WebGLProgramParametersWithUniforms
from WebGLPrograms
since it's used there as a param type for acquireProgram
. Is there a specific reason why it should be in WebGLRenderer
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that should be fine, thanks.
Nice work, thanks for taking that on! Will review soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that was more work than anticipated!
Yeah, and those mixed types were throwing me off 😅 Thanks for the help! |
Shader
Added the missing
defines
property to theShader
interface which is often needed for use cases involvingMaterial.onBeforeCompile
hooks. The property is optional because not all materials have defines:UniformsUtils
The params and return values of
UniformsUtils.clone()
andUniformsUtils.merge()
now use concrete types to avoid troubles withany
in user code.