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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Point light in front of background

Discussion in 'General Graphics' started by mondeon, Nov 9, 2015.

  1. mondeon

    mondeon

    Joined:
    May 29, 2015
    Posts:
    46
    Hello Unity Community!

    I am creating a 2D game (Unity 5.1 @work). In my scene I have an object with a small point light as attached component. The problem: when I set my background, an opaque texture covering the whole screen, the point light is not visible anymore. When I deactivate the background - the point light is visible again. I think the solution is quite simple, I just don't find it and I am struggling the whole day with it already.. Please, help!

    The background picture a child object of a UI Canvas (stretched for main camera, not in overlay mode), the sorting layer is behind every other layer. The object with the point light is at default sorting layer (which is in front of the background layer). Object is visible, but not the light component. What am I missing here?

    Thanks in advance!
     
  2. mondeon

    mondeon

    Joined:
    May 29, 2015
    Posts:
    46
    Anyone have a tip for me here? Getting quite desperate about that problem...
     
  3. StevenGerrard

    StevenGerrard

    Joined:
    Jun 1, 2015
    Posts:
    97
    Not pretty sure, just some guess.
    => Point light is a 3D element, UI Canvas is 2D element.
    => So in common scene, unity will draw 3D mesh first, then draw 2D ui part.
    => Your background is a full screen picture, so maybe the reason is incorrect rendering order between 3d and 2d ?
     
  4. mondeon

    mondeon

    Joined:
    May 29, 2015
    Posts:
    46
    @StevenGerrard so.. what can I do to check/fix/delegate the rendering order?
     
  5. StevenGerrard

    StevenGerrard

    Joined:
    Jun 1, 2015
    Posts:
    97
  6. mondeon

    mondeon

    Joined:
    May 29, 2015
    Posts:
    46
    I have no idea how to edit the "queue" tag, don't really want to mess with shaders at that low level.. Instead I use a work-around with a second camera. Not really awesome, but it does the trick so far...
     
  7. Akrampro

    Akrampro

    Joined:
    Aug 17, 2023
    Posts:
    1
    gerrard is answering unity forum questions, dayum.