Quantcast
Channel: Questions in topic: "hlsl"
Viewing all articles
Browse latest Browse all 206

What happens when the alpha value is outside the 0..1 range in surface shader lighting models?

$
0
0
If I create a surface shader with a custom lighting model, I need to return a half4 containing RGBA values. I noticed that if I set the alpha of the return value to a value outside the 0..1 range, weird things happen. If the value exceeds 1, the color stays opaque but its intensity increases. If the color is white and the value becomes negative, the image gradually darkens and seems to become less transparent? However, if the color is black, the background starts brightening the lower the alpha value becomes. How does this work?

Viewing all articles
Browse latest Browse all 206

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>