Just as the title says. It all boils down to this line https://github.com/mrdoob/three.js/blob/dev/src/renderers/webgl/WebGLPrograms.js#L171. Setting any color for any instance just after the instanced mesh is created, solves the issue. But this is not obvious and looks like it's not documented.
To Reproduce
- Prepare a scene with InstancedMesh
- Render it
- Populate the instanced mesh asynchronously
Live example
jsfiddle
Expected behavior
When setColorAt is called, the shader should be recompiled to include the instanceColor. Or there should be a valid and documented way to make sure that this attribute is always defined.
Platform
- Device: Desktop
- OS: Windows
- Browser: Chrome
- Three.js version: r128
Just as the title says. It all boils down to this line https://github.com/mrdoob/three.js/blob/dev/src/renderers/webgl/WebGLPrograms.js#L171. Setting any color for any instance just after the instanced mesh is created, solves the issue. But this is not obvious and looks like it's not documented.
To Reproduce
Live example
jsfiddle
Expected behavior
When setColorAt is called, the shader should be recompiled to include the
instanceColor. Or there should be a valid and documented way to make sure that this attribute is always defined.Platform