• Advertisement
Sign in to follow this  

encoding alpha channel

This topic is 4156 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Anyone knows how to write a value to alpha channel? I'm using colorwrite enable flag to write to alpha channel only. The problem is that if i write 0.3f into alpha channel in vertex shader, the value becomes inaccurate (something like 0.33...f) when i check it in pixel shader. Any idea? btw, i use A2R10G10B10 format. thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
You are doing the right thing, the problem is that you are using a 2 bit alpha channel, so possible values are:

00b [0] -> 0.0f
01b [1] -> ~0.333f
10b [2] -> ~0.666f
11b [3] -> 1.0f

- Aldenar

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement