|
Is there supposed to be a difference in behavior between the ways of alpha blending objects? The docs for
However, when I started with this, all objects were being alpha blended into the background regardless of the graphics mode: frame
.blend()
.alpha(num!(0.4), num!(0.6))
.enable_object(agb::display::Layer::Top)
.enable_background(agb::display::Layer::Bottom, bg_id);Then I saw frame
.blend()
.object_transparency(num!(0.4), num!(0.6))
.enable_background(bg_id);At the moment I'm testing in mGBA 0.10.5. Does this seem like a bug, either in agb or mGBA? |
Replies: 1 comment
|
So the documentation is definitely wrong around alpha transparency. I'll fix it soon, but last time I thought I understood it I got it wrong too (and what's documented is what I thought was correct). The behaviour is correct in mGBA and The key thing to realise with blending is that only 2 colours can blend together and it'll be the top 2 things that tried to render at that pixel. (at least that's my current understanding) |
So the documentation is definitely wrong around alpha transparency. I'll fix it soon, but last time I thought I understood it I got it wrong too (and what's documented is what I thought was correct).
The behaviour is correct in mGBA and
agbcan represent every state, even if the docs are wrong about them.The key thing to realise with blending is that only 2 colours can blend together and it'll be the top 2 things that tried to render at that pixel. (at least that's my current understanding)