![]() |
|
Alpha on primitives not working as expected? |
jmasterx
Member #11,410
October 2009
|
Did something with Alpha change in RC4 because when I draw a primitive with for example al_map_rgba(255,255,255,50), it just draws it fully white and does not even consider what is already drawn, so no blending is happening. Thanks Agui GUI API -> https://github.com/jmasterx/Agui |
Matthew Leverton
Supreme Loser
January 1999
![]() |
The default blender changed in one of the RCs. Either set it back to what you expect it to be or premultipy your RGB values by your alpha. In your example rgba(128,128,128,50). |
Trent Gamblin
Member #261
April 2000
![]() |
Actually they'd be 255*50/255 = 50, not 128.
|
Matthew Leverton
Supreme Loser
January 1999
![]() |
Right. I was thinking 50%. |
Mark Oates
Member #1,146
March 2001
![]() |
Yes jmaster, blending is different now. You'll need to multiply each color component by the percentage of alpha. It's easier to think of it in floats: float alpha = 0.5f; al_map_rgba_f(1.0f*alpha, 0.53f*alpha, 0.8f*alpha, alpha); Here was my thread on the issue. -- |
|