engine
engine copied to clipboard
Shader chunk API needs finalizing
We're getting more and more interest in the shader chunk system.
We need to finalize the API as currently all variables end with VS (vertex shader) and PS (pixel shader). As the term pixel shader isn't a WebGL term at the least I would suggest we change that. Also it's not common for us to have that format and it is against our coding standards (capitalized abbreviation)
Can we have a discussion here on a new format and migrate the API to it (we should be able to support backwards compatibility).
Possible suggestions:
material.chunks.fs.diffuseConst
material.chunks.vs.transform
Thoughts?
I like either:
material.chunks.vertex.transform material.chunks.fragment.diffuseConst
(I hate acronyms like vs/fs)
Or:
material.chunks.transform material.chunks.diffuseConst
(Do we even need to differentiate between vertex and fragment chunks?)
chunks.vs and chunks.fs seem OK to me Differentiation gives some hints, e.g. we have normal.vert/normalSkinned.vert and normalMap.frag/normalVertex.frag, it would be very unclear what goes where without vs/fs.
There is currently difference between filenames of chunks and variable names, if that can be eliminated as well, it will help easier to navigate and override chunks.