Sign in to follow this  
grunt123

encoding alpha channel

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this