Download

How to simulate long lightstripes?

Hello,

I am currently a bit lost on how to approach lighting of one of my scenes. It is not yet set up in the engine, because I want a solution to the lighting problem before I invest too much time in building it out nicely.

This is one of the concepts for the scene:

In every other recess in the wall, there is a light stripe from the ceiling to the floor. In this concept they are simulated using two point lights each. However, this creates specular reflections which spoil the illusion of light-stripes. That problem can be solved in Unreal Engine using the source radius and length, which creates much better specular highlights. But the light is still a point light, so the attenuation radius has to be large enough that there is no noticable falloff on the sides of the recess. That large attenuation radius then leads to overlapping lights, which is bad.

The lights should be stationary (additional static lights are ok) because the lights change color ingame (from white light to flashing red as an alarm signal). No lights move, so fully dynamic lighting would just be unnecessary overhead.

  • The ideal solution would be a true line/capsule light, i.e., a light where not just the source is a capsule, but the actual geometry rendered in the lighting pass is a capsule and shading calculations are based on the distance to a line and not the distance to a point. But as far as I know such a thing does not exist for Unreal Engine.
  • The next best solution would be spot lights with different opening angles in y and z. This would help faking the effekt, by using a static pointlight in combination with a spotlight wich is narrow in the axis along the corridor and wide in the up axis of the corridor. Again, I don’t know of an implementation of this for UE.
  • As a last resort we would have to move away from the concept to something that is doable in UE, but I hope we don’t have to.

Now the question: Does anyone have an Idea how to achieve a lighting similar to the situation in the concept?

If you don’t need shadows, you should just set them to movable and set the light length to make a tube. Movable lights are actually cheaper than stationary if shadows are turned off, and there are no limits on overlap.

But with dynamic you miss out on global illumination. There’s no reason to use dynamic in this case, just use stationary without shadows. If you have shadows off on stationary lights you can overlap them as many times as you want.

Turning off shadows is not really an option. But if there is no better alternative I think we might still achieve the desired effect by e.g. turing on shadows only on every 3rd light or so.

You could try combining the two approaches, using a row of static point lights for the baked global illumination and a single dynamic light with length (and possibly shadowing on some of them, would need to experiment) for the real-time highlights, but turn off the static lights when playing.

The way I’d approach this myself would be to write a StripLight Blueprint which contains both the static and dynamic lights, and turn off the dynamic light (so it doesn’t appear and overlight the scene while editing). A simple BeginPlay event can then turn on the dynamic light and turn off the static lights.

Movable lights with cached shadow maps should be quite performant.

Thanks for the tipps. I’ll experiment with a combination of dynamic lights and static fill lights. It’s not ideal but revisiting some other games I noted that many games approximate lighting this way. As I never really noticed that before I think that is a reasonable workaround.