Is there a library or a reference for lighting an InstancedBufferGeometry?
There is significant complexity in providing support for directional, hemispherical, point and ambient lights through a shader to replicate what can be done with Lambert or Phong materials yet have the performance gains of batch rendering.
Is there existing code to implement these lights (without shadows, transparency or even specular lighting)?
GLSL is very challenging for a beginner like me, so any help is appreciated!
https://pastebin.com/UUUCFLxV This is a copy of the shaders I am using and some general methods to add and remove objects from the geometry. The fragment shader doesn’t compile currently, however, I can’t find any references for how to work with structs or an array of lights. Most of the documentation I can find refers to an older spec where structs aren’t used.