Problem with one shader for multiple materials

Notice onBeforeCompile runs only once and the js code string of it contributes to a identifier so programs can be shared.

You might see if this plugin helps you as well, as you can use per-mesh uniforms with a single material with it.

1 Like