I’m working on something that requires a sprite to smoothly blend from one texture to another.
The textures are the same size, rotation, scale etc. I can slowly ramp down all the color values on one and ramp up the values of another and the blend is lovely. However, these textures are now being drawn with opacity throughout the transition so everything behind shows through.
I’ve tried drawing a black mask under the transitional objects,(on top of the background objects) but this doesn’t seem to have much affect, if any. Do I need to mix these textures into a 3rd texture and then display that result with full alpha?
And the draw layer… I’ve read somewhere you can assign any draw layer value between 0 and 1 as a single, so .0001, .001, .01 are all valid. So with the command SpriteBatch.Begin(sortmode:=SpriteSortMode.FrontToBack) why do layers .3 and .3001 swap draw order randomly? It seems to happen more when the code draws objects on a lesser layer than something else already sent, ie:
Draw on layer .301
Draw on layer .302
Draw on layer .3 < This layer randomly get’s drawn on top of .302. If doesn’t flicker madly, it’ll swap back and forth a couple of times a second.