engine icon indicating copy to clipboard operation
engine copied to clipboard

Shader chunk API needs finalizing

Open daredevildave opened this issue 8 years ago • 3 comments

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?

daredevildave avatar Mar 04 '16 12:03 daredevildave

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?)

willeastcott avatar Mar 04 '16 12:03 willeastcott

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.

guycalledfrank avatar Mar 04 '16 13:03 guycalledfrank

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.

Maksims avatar Mar 04 '16 14:03 Maksims