3 ms·
I've added custom materials building upon THREE's shader code, and found this part more organized than you're describing, though undocumented. They're using a c
by pierrec 5y ago
I've added custom materials building upon THREE's shader code, and found this part more organized than you're describing, though undocumented. They're using a custom shader preprocessor, and shaders use it to include different "chunks" based the type of material, whether it has lighting/shadows enabled, etc. Some parts are a bit messy, but overall a decent compromise to generate efficient shader code for each material (and I don't think it counts as an "uber shader").
Note this is all without using the new NodeMaterial, which I didn't even realize existed due to the also missing documentation.