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

Does LWRP 2D Renderer support the Scene Color node?

Discussion in 'Shaders' started by JUSTCAMH, Nov 16, 2019.

  1. JUSTCAMH

    JUSTCAMH

    Joined:
    Dec 8, 2018
    Posts:
    18
    Title says it all, the scene color node is only returning a black texture when using the 2D renderer.
     
    alihamie likes this.
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,256
    Technically it does. The problem is the “scene color” is really just the camera opaque texture, which is a copy of the scene after all opaque objects have been rendered. When doing 2D stuff it’s rare to have anything that’s part of the opaque queue range, so there’s probably nothing in the texture to sample.
     
    JUSTCAMH likes this.
  3. JUSTCAMH

    JUSTCAMH

    Joined:
    Dec 8, 2018
    Posts:
    18
    What do I need to do to get these sprites rendering to the camera opaque texture?
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,256
    Make them opaque. Use an alpha test shader, or just modify their material to use a queue of <2500. However you might have other rendering issues if you do that.
     
  5. WallyCZ

    WallyCZ

    Joined:
    Apr 16, 2016
    Posts:
    2
    Has anyone made this to work? I have still black texture regardless in which queue materials are... :(
     
  6. alihamie

    alihamie

    Joined:
    Jun 18, 2015
    Posts:
    7
    I'm still trying to figure this one out JustCam did you find a solution ?