Re: Alpha blending problem
Have you tried:
Code:
SContainer.Begin(SpriteFlags.AlphaBlend Or SpriteFlags.SortDepthFrontToBack)
Re: Alpha blending problem
Sorry does not work. I guess the container is fine, I have to set the renderstate in such manner that it actually adds the two texture colors.
I tried lots of renderstates and color alpha values, but it ll ends up in different colors/color loss.
EDIT
I got it this far:
http://i708.photobucket.com/albums/w...killer/ana.jpg
Code:
Device.RenderState.AlphaBlendEnable = True
Device.RenderState.BlendOperation = BlendOperation.Add
'Device.RenderState.SourceBlend = Blend.DestinationAlpha
Device.RenderState.DestinationBlend = Blend.InvSourceAlpha
If KeyPressed(Windows.Forms.Keys.Q) Then
SContainer.Draw2D(dRTexture, New Point(0, 0), 0, New Point(0, 0), Color.FromArgb(255, 0, 255, 128))
SContainer.Draw2D(dLTexture, New Point(0, 0), 0, New Point(0, 0), Color.FromArgb(128, 255, 0, 128))
Else
SContainer.Draw2D(dLTexture, New Point(0, 0), 0, New Point(0, 0), Color.FromArgb(255, 255, 0, 128))
SContainer.Draw2D(dRTexture, New Point(0, 0), 0, New Point(0, 0), Color.FromArgb(128, 0, 255, 128))
End If
Little dark for my taste...and it's a weird way of using alpha. On the other hand, the scene is empty on start. It's logical the alpha values of the first render are always 255... xD