Hello, I work for LunarG and helping maintain GLSL/glslang
I am aware three.js has to likely generate GLSL in order to target WebGL
If this is true, is there any use/desire in adding a [[non_semantic("some info")]] keyword into GLSL language? (Realize this is less of a issue and more of a “can I help?”)
The idea is that if there is logic in this repo where you have data you wish you could just save in your GLSL for convenience and not have glslang (browsers) yell at you, I would love to add something like to to GLSL for you? (But I have zero knowledge how you generate GLSL)
Yes it’s already the case. With the use of ShaderChunks: fragmented code split into reusable piece included in the core. You can call them on JS execution, compose shaders, replace fragments with your own using onBeforeCompile. Here is the complete list:
And ShaderLib contain the native “preconstructed” shaders/materials using these chunks. Here is the source for MeshBasicMaterial as an example:
This system is becoming obsolete and will not evolve much in the future. It’s replaced by the use of TSL and node materials providing a complete abstraction of the code + GLSL / WGSL compatibility.
Yeah this too, I don’t think that a 3rd party has anything to contribute with shader compilers here. TSL is the future of three and it’s all JavaScript. You are targeting the wrong language here basically.