re: command buffers Example: I have a point light. I have a second sphere. I only want the objects inside the second sphere to be effected by the point light.

Yes, so what I wrote before, and the solution depends on whether you're using forward shading or deferred shading.

In forward shading, you'd have to do sphere check inside the shader part that evaluates the point light, and don't add any illumination outside of that sphere's range. This means all the shaders of all objects in the scene need to know about this, an be modified to do this. In deferred shading, the change would be isolated only in the deferred lighting pass shader, so that's easier to do.

Or alternatively, *maybe* some sort of multi-camera and/or stencil trickery could achieve what you want, but I have no immediate ideas on how to.

View more

Ask @aras_pr:

About Aras Pranckevičius:

Graphics programmer and code plumber at Unity

Kaunas, Lithuania

#graphics #programming