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 Null value in shadergraph?

Discussion in 'Shader Graph' started by ATMLVE, Sep 28, 2023.

  1. ATMLVE

    ATMLVE

    Joined:
    Jun 11, 2023
    Posts:
    35
    I'm probably mistaken but I really can't figure out what I'm seeing in shadergraph.

    Below is a basic setup, it's taking a long-calculated input and comparing it to an arbitrarily large value of 20,000. If the input is less than 20k it's green, else it's red:



    So when I switch that to greater than or equal to, the colors should reverse shouldn't they? They don't, the "outside" is still false:


    What am I missing?
     
  2. FredMoreau

    FredMoreau

    Unity Technologies

    Joined:
    May 27, 2019
    Posts:
    96
    Hi @ATMLVE,

    I did a simple similar test using the distance from camera, but didn't get the problem you're facing.
    Can you provide more details? Which Unity / Shader Graph versions and what Render Pipeline you're using?

    Screenshot 2023-09-29 at 11.35.33 AM.png

    Screenshot 2023-09-29 at 11.35.13 AM.png
     
  3. ATMLVE

    ATMLVE

    Joined:
    Jun 11, 2023
    Posts:
    35
    Hi Fred, I know this is obscene but this output is coming from the value dstThroughAtmosphere labeled on the shadergraph below on the bottom right. Everything else before that feeds into the value... It's hard to follow, but this is an image I'd already uploaded before from a while back:


    The unity version is 2022.3.9f1, I'm not sure what shader graph version but nothing earlier than this June.

    For what it's worth, this is trivial to get around. I just make that same logic check but output 0 (which is what I need and what it should be) instead of the color red, and add it back in and that works. I just wasn't sure if I was missing something stupid.