Search Unity

Resolved Force alpha to be 1 or 0

Discussion in 'Shaders' started by Abended, Jun 28, 2021.

  1. Abended

    Abended

    Joined:
    Oct 9, 2018
    Posts:
    142
    Dipping my toe into editing some HLSL.

    I am reading an alpha channel of an RT, and I am pretty sure my issue is that I need alpha to be less grey.
    This is a look at the current alpha channel:
    upload_2021-6-28_6-33-54.png
    And I think to get a clean effect, I need it to be interpreted more like this:
    upload_2021-6-28_6-35-0.png

    I am currently doing a 1 - on the tex.a, which is working, but the grey stays greyish after the 1 - and the clip doesn't fully take effect. I must be learning, becuse I feel like I explained it well enough for someone to understand.

    I was searching around and I see that there is a step method that seems to be in the direction of what I'm after, but I just can't get there.
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,411
  3. Abended

    Abended

    Joined:
    Oct 9, 2018
    Posts:
    142
    That did it! The definition of step I had previously found was a half3, so I didn't think it was correct, but the page you linked showed that you could just do it on a float! Thank you! Getting there!
     
    Last edited: Jun 29, 2021