Multiply blend mode does not work with alpha
As the title says, multiply blending does not work with alpha on textures, nor does the SetImageState change its opacity. Example:
Code:
SetImageState("image:ReimuFake_1", "mul+mul", Color(100,5,5,5))
Render("image:ReimuFake_1", 700, 155, 0, 1, 1)
SetImageState("image:ReimuFake_1", "", Color(255,255,255,255))
Render("image:ReimuFake_1", 675, 175, 0, 1, 1)
I apologize if there's any known method to avoid this. If there is, I'd love to know about it. And if this is intended behavior, I'd like to know why, too.
In my considerations, the mul blending mode should be used with fully opaque images:
- with white representing a factor of 1.0
- black representing a factor of 0.0
If the alpha channel is taken into account, how does it participate in the calculation?
There are some possible calculations:
-
background-color*image-color*image-alpha? - lerp(
background-color,background-color*image-color,image-alpha) ?
I think these calculations are confusing... So I ignored the alpha channel.
In LuaSTG-Evo, the multiply blend mode works with alpha, so I assumed the same would apply for Sub 😭 It's confusing to me why it wouldn't, seeing as mul+rev can replicate a similar effect when manually inverting the used texture's color on an image editor.