Hi All,
Blending is a pain for me, I am trying to write a simple tile engine, the images are ok, everything looks fine, but when I draw it on Direct 3d is showing a small line between every sprite, indeed, I create a wrong coast line that goes into the previous tile and you can see the effect. I am pretty sure is something wrong with the blending, can anybody check the code or explain me how blending works? Thanks a lot.
Init:
Draw:
Of course I am closing and I didn't put any extra init code, my blending is showins as the attached file.
Can anybody help me please?
thanks!!
Blending is a pain for me, I am trying to write a simple tile engine, the images are ok, everything looks fine, but when I draw it on Direct 3d is showing a small line between every sprite, indeed, I create a wrong coast line that goes into the previous tile and you can see the effect. I am pretty sure is something wrong with the blending, can anybody check the code or explain me how blending works? Thanks a lot.
Init:
Code:
_objDD.RenderState.CullMode = Cull.Clockwise;
_objDD.RenderState.Lighting = false;
_objDD.RenderState.AlphaBlendEnable = true;
_objDD.RenderState.SourceBlend = Blend.SourceAlpha;
_objDD.RenderState.DestinationBlend = Blend.InvSourceAlpha;
_objDD.Clear (ClearFlags.Target, Color.FromArgb (255,0,0,0).ToArgb(),0,0);
Draw:
Code:
m_MainSprite.Begin (SpriteFlags.AlphaBlend);
m_MainSprite.Draw (
m_Map [FirstHeightTile,FirstWidthTile,0].Tile_Texture,
m_Map [FirstHeightTile,FirstWidthTile,0].Frame,
VectorNull,
Vector,
Color.FromArgb(255,255,255,255).ToArgb() );
Of course I am closing and I didn't put any extra init code, my blending is showins as the attached file.
Can anybody help me please?
thanks!!