iOS - static spot lights not working in editor or on device

I’ve been trying / fighting with unreal to get spot lights to work, but with no luck. It starts in the editor. If I pop a spot light in a blueprint it works without a hitch. But as soon as I build the lighting, they vanish. Not only that, once I get my build on the console, there are no lights at all. I followed all the steps in the Unreal documentation for mobile lights. You guys claim that they work on mobile if set to static, but this does seem to be the case… for that matter they don’t even work in the editor when lighting is built.

This is what it looks like when i slightly move a tile to undo the light baking and what it should look.

As soon as I bake lighting or send to the iphone, I get this as a result -

Here is my property tree for the lights down the middle -

The only way I seem to be able to get the spot lights to stay visible is by setting them as stationary, but that doesn’t work on mobile. I should point out that for a while I had stationary point lights working, but now I can’t seem to get them back when sending to the iphone. The lighting methods for mobile seem to be completely broken.

I’m using 4.10.3. Thanks for the help.

Hi Floggins,

I’m not seeing the same on my end when using static spot lights.

This seems like an issue possibly with a low lightmap resolution on your floor mesh. Try using a higher lightmap resolution. If that doesn’t work try using a default scene, remove the directional light, and place a spot light set to static with the default settings. Then build the lighting and you should see the spot light baked.

Let me know if that works.


Hi Tim. OK, I’ll give that a shot. What do you recommend as a resolution for lightmaps? I want to save as much memory as I can (obviously). As as example of mesh size - that room mesh you see is one big object. The props (hanging lights) are different objects. Am I better to break that up into many smaller pieces? I had an idea of making each wall piece individually an recreating the sets within the blueprints. I just don’t like the idea of having so many props for the background geo. I wanted to save my budget for set props.

Also, our game will be dynamically generating the world using those tiles so I want to make sure that there as few assets to spawn at once in a tile to not create any stalls.

I’ll offer some tips for static lighting, but I do want to mention that it will all be for a waste if you’re going to dynamically generate the world. Since static lighting is precomputed it cannot work with procedural games.

That being said, here are some tips for breaking up the level and lightmaps.

  • The key here is to find a balance between draw calls and modular design to get the best results.
  • Break the mesh into smaller pieces that are repeating. This doesn’t need to be extremely small pieces, but something that is a 500-1000cm in width should be good.
  • For large floor meshes it can be OK to use a single one, but this will use a larger lightmap to fill the 0,1 space. Breaking it up into smaller chunks that were a couple of thousand cm can work better for keeping lower lightmap resolutions.

The main key here is to make sure that the lightmaps UV space is being used efficiently to get the best result at the lowest resolution. If using more modular pieces works for that then you’ll have an increase in draw calls, but you also get the balance of not having a single large lightmap texture. The increase in draw calls would likely be a better move for mobile than a large texture resolution since you can use Precomputed Visiblity Volumes to cull for mobile game projects and remove the asset when not in view.

Limitations with mobile and dynamic lighting.

  • IIRC Spotlights dont’ currently work on mobile for dynamic use.
  • You can use up to 4 dynamic point lights in your scene view and these do not yet support shadow casting. This number can be increased in the Project Settings > Rendering > Max Dynamic Point Lights
  • Directional Lights can be movable and shadow cast dynamically, depending on the device.
  • There is not any Dynamic Global Illumination, so shadowing will be dark unless using a skylight.

to be honest, we’ve been on the fence about generating on the fly for this exact reason. I was afraid we would run into limitations with the lighting that would block us. I was really hoping that you were going to say that the lightmaps are baked into the blueprint data, but that was a bit of a pipe dream. Actually, maybe what I can do in turn them on only when within a distance. that will be easy in blueprints.

When you say 4 in a scene view - I thought the limitation was 4 sharing the same surface? In this scene I scaled the lights down enough so that none of them overlap. I’ll turn off the shadow casting on the spot lights also. It’s bummer, but it’s something I can deal with.

Lastly - all that being said, I tried to put in dyn point lights but they just… stopped showing up in my iphone builds. Not really sure why because they used to work. I’m starting to think that there’s actually a bug with the lightmaps or build data and the lightmaps are permanently there. I turned off lightmap baking to remove them but I’m not convinced because as you can see - the lights still all turn off. Maybe I’ll try clearing out all the cache and build data to see what happens.

You’re right on the dynamic point lights. I misspoke on that one. :wink:

What iOS device or any other devices are you using to test on? I can see if can run through this and see if there may be a bug there with something like what you tried.

For the life of me, I just can’t get spot lights to work at all. I’m sending to latest on iOS on iphone 6. I changed my lights to be a single movable point light. it’s the only light that renders anything for me on the device, so long as I turn off shadow casting, because that doesn’t work either. Any light that casts a shadow just doesn’t show up on the device. I also turned off the directional light entirely to make sure there was no interference with that and to make sure my scene is as neutral as possible. So, again - the only type of light that renders on the device is a movable point light with shadow casting turned off. That’s it.

This is incredibly frustrating.

I’m really starting to get the impression that Unreal is just not ready for mobile prime-time just yet. There’s so many quirks and dead ends.

well, even more backwards progress. I tried to use modulated shadows from the directional which requires lights to be set to stationary. If I do that, the light does not show up either, which I guess makes sense because stationary lights are basically the same as static + some tinting abilities, right?

Is there really no way of baking lighting into a blueprint instance? I feel like that would be a good solution for this game type - dynamic loading tile engines. Actually, it’s not even fully dynamic - they’re placed on load and then stay that way (think dungeon generation). What would be ideal is some way to bake lighting into a map in the generation phase.

I made an interesting discovery. If I set the render preview to ES2, I get the same results as the device. Meaning nothing working except for point lights with or without shadows (it doesn’t matter because the shadow cast flag seems to be ignored entirely and turned off). Lights other than directionals, just don’t cast shadows. Even stranger - if I turn off shadow casting on the directional while in ES2 preview, the light just turns the directional off completely.

I just can’t get spot lights to work at all.

As I had pointed out earlier in the limitations above, Spot Lights are not intended to work currently as dynamic lights.

Is there really no way of baking
lighting into a blueprint instance?

Not currently. I highly doubt there are any plans to change this in the future either.

I have a simple test map I made that has static, stationary, and dynamic point and spot lights and a movable directional light. From what I see on my end everything checks out as intended.

You can try it here for yourself if you’d like to see if you see the same.
**Ignore the name of the project this was originall a packaging test I had for another one of our support staff.

thanks for the test scene.

Oh, sorry - misread the bit about the spot lights. But I still can’t get my object to generate light maps. No matter what resolution I set the lightmaps to on my objects it just bakes nothing at all. Are there any lighting components required to go along side lightmaps for visibility? Anyway, I guess it doesn’t really matter because pre-generating the levels is something we don’t want to do. So I guess I’m stuck using shadowless dynamic lights. Do you know if there are plans to allow us the option to cast shadows from dyn lights? and also - are there plans to support dyn spot lights?

I was sure I read (and that you confirmed) that that dynamic lights were maxed out at 4 per shared surface but this doesn’t seem to be the case for me. I put bunch in my scene that were not crossing over each other and it only rendered a max of 4 within that blueprint. I even separated my mesh into smaller pieces, but my guess is that on import it’s combining the objects into one big surface. I was hoping that it would leave them as separate pieces. If I turn off the “combine” option is imports tons of unique assets. It would be cool to have a sort of “mesh pack” concept. Where sub meshes all get imported as one asset but are still all unique surfaces under the hood.

I’m guessing I’ll need to break my objects up into parts and rebuild the rooms from many smaller components. I hope that having all dynamic lights will work at that point.

I don’t know of any immediate plans to implement shadowing for movable point lights, at least that I can see on the Trello for work that is directly planned.

The release notes for 4.9 say for each object being illuminated. So if you’re lighting your entire floor section that would only be able to have 4 lights affect it. I tested this in the map above, with 5 point lights, and only the 4 show up as expected. I just used the template floor as my surface. I then placed multiple lights on each corner of the floor pieces and when more than 4 lights are touching a single surface some of no longer working.

Breaking the objects into smaller chunks is not always the most ideal way to do it for mobile, but with the limitation of dynamic point lights and per-surface that would be the best option to get all the lights working dynamically with your procedural setup.

hey Tim,

ok, so I spent a while and broke my mesh into pieces. It solved my problem but as predicted created a pretty big hit on perfs. I’m going to have to rethink the way our game is lit. I have some ideas, so I’ll give it a whirl.

I also really don’t like the way the ES2 rendering of lights looks on the device. The falloff is not pretty at all. It almost feels like real time vertex lighting with way too harsh of a falloff, which i assume is due to the lower precision. Hopefully when metal is better integrated, things will look better overall, but until then I’ll try to come up with some other solution.

My goal is to have dynamic console-grade indoor lighting running at 60 fps on the iPhone 6 and up. This is definitely not an easy task. :slight_smile: So far it’s close, but a lot trickery will need to take place with all the limitation of the lighting system in Unreal on mobile devices.

wow, sorry for never getting back to you. I was never notified on your reply here. I’m working with an iPhone 6