Modifying StandardMaterial or custom ShaderMaterial?

Just for clarification. Are you talking about 3D object when using the word “instances”? If so, would it be possible to share a single material? Or do you need to parameterize the materials differently?

No, it’s not. It’s probably best if you develop a helper function that clones the material and applies the onBeforeCompile() callback to the cloned materials.

I would not create a custom material from scratch via ShaderMaterial if you only want to modify the built-in shaders at a few places. For more extensive rewrites, a custom material would be indeed better.

1 Like