Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Deferred Lighting Issues

Discussion in 'iOS and tvOS' started by docjaq, Sep 15, 2014.

  1. docjaq

    docjaq

    Joined:
    Aug 26, 2014
    Posts:
    6
    I'm having problems with deferred lighting in Unity Pro when building for iOS: point lights do not create shadows.

    At runtime, selecting a point light, I get the warning 'Only directional lights have shadows in forward rendering." Deferred lighting is selected in 'Player settings' for iOS. I have only one camera, and setting the rendering path there manually also has no effect. I have set 'Quality' settings to Fantastic for iOS, just to make sure.

    A directional light in the scene creates shadows as expected. When the project is built for x86, the scene results in shadows from the point lights. No lightmaps are baked in the scene.

    Am I missing something here? Should this be working?
     
  2. bluescrn

    bluescrn

    Joined:
    Feb 25, 2013
    Posts:
    628
    I suspect that you may be rather overestimating the power of mobile GPUs...
     
  3. docjaq

    docjaq

    Joined:
    Aug 26, 2014
    Posts:
    6
    In what sense? As I understand it, Unity does support deferred lighting for iOS/Android now (with OpenGL ES 2.0/3.0). But enabling shadows from a point light seems to imply that deferred rendering is not working correctly (i.e. it tells me that they wont work with forward rendering). If it's a performance issue, then that's fine. But the support seems there, so I'm confused with what's going wrong.
     
  4. bluescrn

    bluescrn

    Joined:
    Feb 25, 2013
    Posts:
    628
    Deferred shading requires an awful lot of fill rate and shader power. Cubemap shadows from point lights also require a lot of GPU power. While it may technically be functional, I wouldn't expect it to be usable in a real-world game - definitely not on an iPhone 4, probably not on a 4S.

    Realistically, for a mobile game, you want to limit shadows to one shadow-casting directional light, from a few carefully-selected objects onto a limited set of shadow recievers. As for lights, you want to bake as much as possible, or use per-vertex ligthing (which sadly doesn't work with lightmaps in Unity). Per-pixel lights are best avoided, or used sparingly, as they don't come cheap.
     
  5. docjaq

    docjaq

    Joined:
    Aug 26, 2014
    Posts:
    6
    Yes, sorry, I appreciate that you're trying to help, but I'm well aware of the limitations of mobile GPUs. Indeed, this is not an attempted answer to my question at all. My question was, essentially: "Why, after enabling deferred lighting, do point lights not cast shadows when building for iOS?"
     
  6. docjaq

    docjaq

    Joined:
    Aug 26, 2014
    Posts:
    6
    OK, seem to have found the reason behind this: it seems to be an iOS Pro feature, not a Unity Pro feature. Why the UI will let me tick 'Deferred lighting' and not tell me it's an iOS Pro feature, when it won't let me tick, say, 'Static batching', for which it tells me it's an iOS Pro feature, is beyond me. Ho hum.