Multiply mode in SpriteBatch
Posted
by
ashes999
on Game Development
See other posts from Game Development
or by ashes999
Published on 2012-12-16T13:02:55Z
Indexed on
2012/12/16
23:22 UTC
Read the original article
Hit count: 187
I have a "lighting" texture (black background with white or colours for lights) that I want to draw as a multiplcation operation. SpriteBatch.Begin
can specify BlendState.Additive
, but there's no BlendState.Multiplicative
.
I also tried the solution in this answer, but it didn't work -- even when I (incorrectly?) changed the code to work with XNA 4 style ColorDestinationBlend
, I ended up with the final solution being inverted (black area where the light is, everything else is visible).
I initially thought of a shader, but I couldn't get shaders to work with MonoGame, so I'm falling back to SpriteBatch
.
© Game Development or respective owner