Build lighting

So I had a bunch of static lights that I had set to not visible (so it was dark) and were supposed to turn on once the player reached a point, but when I went to go build my lighting (since I still had some lights on), it built the lighting as if EVERYTHING was turned on, and now I have no idea how to undo it or reset my level to get rid of the lighting. Basically, toggling the visible setting in the details panels doesn’t do anything, since the lighting already been baked into everything. All the places that were supposed to be dark are now lit and moving the lights or toggling the visibility doesn’t chance anything and I really don’t want to have to delete all the lights, rebuild the lighting to fix it, and put them all back in again.

I don’t understand why the build lighting even forced all of them on in the first place. Restarting the engine does nothing either. Is there anyway to remove the “built” lighting? Like reset to default?

Even the lights that are set to Actor Hidden in Game were built as if they were turned on. It’s driving me nuts.

Edit: So I managed to fix it by unchecking “affects world” for every single light I have, rebuilding, and then rechecking it, but now I’m back where I started, with the “Please rebuild lighting” warning hanging at the top. I honestly think I’m going to ignore it. Some of these lights don’t turn on until the player triggers them.

Hi Skyrius,

Lighting doesn’t work in UE4 in the way that you’re intending to use it.

When you use the “visible” checkbox or the eye in the world outliner this does not disable the light from being used. This just makes it disabled for your work in the editor. As you figured out you will need to adjust the value for “affects world”, especially when using static lighting since this is pre-computed and baked for the scene you’re in.

To speak about your intended use, static and stationary lighting cannot be used for what you’re trying to do, because this type of light uses baked lighting. While the stationary light does have a dynamic component for any movable objects in the scene the toggle will not work to disable the pre-baked lighting. To have a light that can be toggled on and off you will need to use a movable (dynamic) light. We have several tutorials for doing this on our Unreal Engine YouTube channel. Here is one such example: - YouTube

If you use a dynamic light that is able to be triggered on and off you will not have to worry about the “Lighting Needs to be Rebuilt” warning anymore.

I hope this helps.

Tim

Thanks. I was under the assumption that dynamic lighting cost more computation wise and most of my triggerable lights never move so it seemed somewhat pointless to make them moveable

Dynamic lighting when cast shadows enabled is expensive, but this is dependent upon how many shadow casting meshes are visible in the scene. within the lights radius. Having movable lights is the only way to have lights that can be turned on/off because static lighting is baked into the texture and cannot be cleared with a trigger. Keeping the radius small enough for the area you intend to have the light shouldn’t be a problem. Having thousands of meshes that this light casts shadows on when turned on can cause a bottle neck though if the meshes are within the radius. It’s just a matter of setting it up and testing in standalone game mode with Stat Unit and Stat FPS (console commands) to see if you’re noticing any slow downs. If so, then profiling your game can help you find where the bottle necks are occurring.