can anyone explain to me how i could use clip() on pixels with a certain greyscale. f.e. clip pixels that are darker then a certain level of grey? it would be much appreciated.
Mr. Me
can anyone explain to me how i could use clip() on pixels with a certain greyscale. f.e. clip pixels that are darker then a certain level of grey? it would be much appreciated.
Mr. Me
Try
clip(alphaValue - valueYouWantToClipBelow)
Thanks,
but i found a way to do what i want using the Alphatest function. Does anyone know if there is much performence difference between these 2?
It depends on the exact scenario (you can test yours), but they should be pretty similar.
Isn’t discard going to be ever so unnoticeably faster, unless your limit is 0 (inclusive), due to the lack of subtraction?
I expect that he compiler will emit very similar code either way. You could check, though, by opening the compiled shader to look at the assembly.