Jump to content
  • Advertisement
Sign in to follow this  
grunt123

encoding alpha channel

This topic is 4369 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!