Original Post
Hi, I have two cloud textures (n texture stage 0 and 1) which I'm blending between to simulate cloud movement in the sky. These are my settings: The variable a changes slowly from 0 to 255 and back. This sort of works. But I noticed a mistake: There are many transparent (black) areas through which you are able to see the sky color. But the blending doesn't work properly here: When the factor a changes, black mingled with black doesn't stay black, but becomes a dark grey before changing to black again. So the sky color between the clouds gets darker and brighter from time to time. Can somebody please tell me how I perfectly blend two cloud textures, whereas black means transparent? Thanks, Chris
d3dDev.RenderState.DestinationBlend = Blend.InvSourceColor
d3dDev.RenderState.SourceBlend = Blend.SourceColor
d3dDev.RenderState.AlphaBlendEnable = True
d3dDev.RenderState.TextureFactor = Color.FromArgb(a, 0, 0, 0).ToArgb
d3dDev.TextureState(0).ColorOperation = TextureOperation.BlendFactorAlpha
d3dDev.TextureState(0).ColorArgument1 = TextureArgument.TextureColor
d3dDev.TextureState(0).ColorArgument2 = TextureArgument.Current
d3dDev.TextureState(1).ColorOperation = TextureOperation.BlendFactorAlpha
d3dDev.TextureState(1).ColorArgument1 = TextureArgument.Current
d3dDev.TextureState(1).ColorArgument2 = TextureArgument.TextureColor