Looking for a way to add ambient lighting based on worldposition

Hello!
So I’m working on my spare time project and keep running into this problem:
Basically I have rooms, and some of them should be lit, while others should be pitch black dark. For simplicity the rooms width, depth, height is perfectly aligned to the units grid.

So what I am looking for is a way to have control over the rate any rendered pixel is affected by ambient lighting based on its world position - Area based ambient lighting

I’m absolutely no shader person, but I hope someone can help me out. My best guess how to do this would be something like so:

  • Disable standard ambient lighting.
  • Add sort of screen space ambient lighting to the camera

Now in the render pipeline:

  • grab the output before shadows are applied
  • I can supply a generated greyscale 3D-Texture (resolution would be one pixel per cubic unit)
  • bring both together to generate the “areal” ambient lighting
  • add the result to he output after shadows where applied.

Is this even possible?
This would really help me with my project :slight_smile:

Thank you :slight_smile:

Can’t you just use light probes for this?

I’d like to. However, levels would be procedurally generated, so I’m not sure its possible