Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feedback Why dither node is in range [0-2]

Discussion in 'Shader Graph' started by koirat, Nov 8, 2020.

  1. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,068
    Why not [0-1] like 0 complete black and 1 complete white ?
    Right now it looks like I have to use number 2 for complete white.
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,329
    The dither node returns a value between 0.05882 and 0.94117 (actually 1.0/17.0 and 16.0/17.0). It’s designed for dithering alpha, in which case it’s helpful to have a value range that’s not quite 1.0 for the highest value. Though I’m honestly not sure why it’s not a range of 0.0/16.0 to 15.0/16.0, there’s probably cases where not having 0.0 is useful too.
     
  3. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,068
    I'm talking about the input.

    Why is it helpful ?
    Actually I find it a little harmful if I cannot set Alpha Clipping to 1.
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,329
    The usual use case for dithering in Shader Graph would be to set the Alpha value like you would normally for an alpha blended transparent object, and set the Alpha Clip Threshold twitch the output of the Dither node. If the Alpha Clip Threshold is 1.0, then something that’s “fully opaque” can have holes wherever the dither is 1.0 in some situations.
     
    koirat likes this.