Skip to main content
gamedev.net
🔒 Locked

encoding alpha channel

Started by grunt123 0 replies 750+ views
Original Post
grunt123
grunt123
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
Aldenar
Aldenar
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.0f01b [1] -> ~0.333f10b [2] -> ~0.666f11b [3] ->  1.0f

- Aldenar

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.