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

Bug Forward+ broken with Reflection Probe node in ShaderGraph

Discussion in 'Universal Render Pipeline' started by aveakrause, Apr 21, 2023.

  1. aveakrause

    aveakrause

    Joined:
    Oct 3, 2018
    Posts:
    69
    Using the reflection probe node in Shader Graph causes a flicker. When paired with bloom, this blows the screen out white because the flicker is of very high intensity.

    Reproduction steps:
    Create a fresh project in a version that supports Forward+ (I confirmed this bug in 2022.2.11f1 & 2022.2.15f1)
    Delete the Post Processing Volume
    Go to your URP renderers and switch them to a Forward+ rendering path
    Create a new URP Lit shader graph
    Add the Reflection Probe node, and connect it to the Base Color
    Save Asset
    Add a reflection probe into the scene
    Bake the probe
    Create a new material using the shader created above
    Add a Cube into the scene
    Assign the material to the cube
    Enter play mode
    Observe flicker

    You can see a video of it here
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,393
    Did you already file a bug report with this project?
     
  3. aveakrause

    aveakrause

    Joined:
    Oct 3, 2018
    Posts:
    69
    I hadn't, but I have it uploading the bug report now.
     
    DevDunk likes this.
  4. DEEnvironment

    DEEnvironment

    Joined:
    Dec 30, 2018
    Posts:
    436
  5. peterbay

    peterbay

    Unity Technologies

    Joined:
    Nov 2, 2017
    Posts:
    100
    While we work on the fix, I can provide some context for why this is happening. With Forward+, we're no longer culling lights or reflection probes per object since we use a spatial data structure to get the same information instead. We disable the computation of the old data for performance reasons.

    Unfortunately, it turned out that the Shader Graph node here doesn't actually go through the same path as reflection probe sampling in the URP Lit shader. That also means that it does not support Box Projection - although the fallback from that is a bit more gracious.

    So basically, in Forward+ it ends up sampling a texture that hasn't been set to anything, and apparently that just gives you flickering rather than an error.

    We need to fix this for sure, but we can't actually fix it with the current node interface, as the node doesn't take a position in, but only a direction. This is also why it cannot support Box Projection at the moment. So the fix (on our side) will be to add that input to the node, and then make it go through the proper code path.
     
  6. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    631
    Hi, thanks for the clarification! I think it'd be nice if there'll be a function to sample the URP reflection probe atlas. And the node can use it too.
     
  7. Liderangel

    Liderangel

    Joined:
    Jul 8, 2018
    Posts:
    99

    Has a fix been deployed for this?