createInstance with ShaderMaterial does not render

When a mesh with a ShaderMaterial is instanced using createInstance the instance does not render.
Removing the ShaderMaterial will cause the instance to render.
clone works as expected.

This looks like a bug to me, unless there is some setting I’m missing.

See playground (

Hi @CarlBateman

I think this is expected. You are using your own custom shader which doesn’t have instancing support. Please check the following PG. I added instancing support from BABYLON instancing shader. Most of my changes are in your vertex shader. In js code, I only added an additional uniforms declaration “viewProjection” to your shader material.

1 Like


@CarlBateman Mistakenly deleted my answer by using touch pad. :rofl:

Add the PG again:

[Admin have undeleted your post]

1 Like