Light Instancing (Similar to geometry instancing)

The basic idea here is - What if lights could be instanced similar to how geometry is instanced? Through textures, chops, dats etc. specify various lighting attributes such as intensity, falloff, position, color, cone angle, shadow enabled, etc etc.

With out consideration of how difficult this would be to implement currently, and what practical drawbacks might arise, I think there are two very significant limitations this would help us surpass:

A) The 32 light COMP limit. My guess is this comes from the fact that each light COMP pre computes lookup textures, and shaders have limits on the number of texture samplers that can be used?

B) The performance scalability issue of rendering scenes with lots of animated light sources. Currently as more light comps are animated, they must also cook. CPU overhead will increase pretty linearly. Having the ability to instance lights gives us the same advantage instancing geometry gives us over duplicating a bunch.

With the coming addition of Vulkan, and the potential additions such as deferred shading systems and other things, it would seem logical to eventually have the lighting system refactored so that it can be more flexible, and more scalable.

With a lighting system where bottlenecks are no longer CPU bound or sampler count bound, optimizations and acceleration structures like those used in Clustered Shading could be much more elegantly and simply layered into Touch’s system, with out reinventing most of the rest of the wheel, making more advanced lighting effects and other post process effects easier for the community to author in a modular way.

I realize there are some challenges here…

For instance - Shadows are expensive… They are an active area of research in the real-time rendering world, shadow maps are fine for a few lights, but taking it to higher counts has not been accomplished yet. The simple fact that for every shadow, the 3d scene must be rendered from the perspective of the light. So, even if we could shade 100 lights, we cannot really shadow 100 lights. Not so much a limitation of Touch, but just from my research and understanding a limitation anywhere you go. Maybe some optimizations could help, but it’s still going to be limiting.

Also, I realize that while something like light color would be easily instanced, stuff like attenuation which is calculated into lookup textures, are probably more complicated to assimilate into an instancing structure?

None the less, I wanted to put this thought out there because I noticed it has come up in the forums a couple times and it’s just been floating around my head :slight_smile:


I think Matthew did the closest thing to what you’re talking about

I need to catch up a bit more to add anything else myself, so… really interesting topic, bump.

Though I think I would go to you for any lighting questions… Didn’t you just make something that runs 264 moving lights realtime on a gtx1070?

1 Like

Yeah! I basically realized after a while was that I was recreating nearly all of the stuff that Derivative had built, with a few changes that allowed me to access light data through an “instanced” like texture buffer. Would give others lots of opportunities to do interesting things with lighting with out nearly as much work if there was some way to get around the 32 light limit in a dynamic setting.