blend_premul_alpha render mode
Asked Answered
J

3

0

What's the exact blending operation that blend_premul_alpha shader mode applies to pixels?

Jurisprudent answered 17/9, 2021 at 7:0 Comment(0)
H
0

premul_alpha is premultiplied alpha.

When the alpha component is equal to 0, it behaves as an additive blend mode. When the alpha component is equal to 255, it behaves as a mix blend mode. Anything between will be a mix between an additive and a mix blend mode.

You can read more about premultiplied alpha here: https://limnu.com/premultiplied-alpha-primer-artists/

Halifax answered 17/9, 2021 at 22:27 Comment(0)
J
0

So it's a blending mode used to "properly" draw textures that are already premultiplied? Equivalent to opengl's (GL_ONE, GL_ONE_MINUS_SRC_ALPHA)?

Jurisprudent answered 18/9, 2021 at 2:31 Comment(0)
H
0

@xyz said: So it's a blending mode used to "properly" draw textures that are already premultiplied? Equivalent to opengl's (GL_ONE, GL_ONE_MINUS_SRC_ALPHA)?

Yes :)

Halifax answered 18/9, 2021 at 20:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.