Closed gateian closed 2 months ago
So while we can add a shader to an instanced mesh, it's worth considering that we do not have lighting and shadows. I'd have to write all that in my code. Might be a better approach to look at injecting shader code into the existing materials as outlined in this thread.
https://discourse.threejs.org/t/apply-shadow-in-shadermaterial/53833/3
Tricky to add shader it seems. Here is a working code example. https://codesandbox.io/s/d3-force-react-three-fiber-instanced-mesh-8zrp4?file=/src/Renderer.js:6224-6230