But I am getting a strange problem when I draw texture over top of each other I get artifacts that shouldn't be coming from the textures themselves I double checked every pixel and its the correct colorkey (000000) true black.
Basically what im doing right now is drawing the "river bed" tile, then drawing the "water" tile with a alpha on it.
Then drawing the "grass" tile on top of that but im getting strange blackness where there should be none..
Attached are a picture of whats going on with original samples of each texture
Also Please only look at the top left corner to see whats really happening, the rest is just exaggerated because the texture is not fully cleaned up.
alpha 125
alpha 255
alpha 255
You can see the black artifacts in last one.
Here is how im setting my renderstates and texture states
//Setup rendering statesd3dDevice->SetRenderState(D3DRS_LIGHTING, FALSE);d3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);d3dDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);d3dDevice->SetRenderState(D3DRS_SRCBLENDALPHA, D3DRS_DESTBLENDALPHA);//Setup Texture Statesd3dDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE);d3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_MODULATE );
Loading my textures like so
D3DCOLOR colorkey = D3DCOLOR_XRGB(0,0,0);
D3DXCreateTextureFromFileEx (D3d, TexturePath, 0, 0, 1, 0,
D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, D3DX_FILTER_NONE, D3DX_DEFAULT,
colorkey, NULL, NULL, &d3dTexture)
And to draw each "tile" I am just using below after I setup the vertices
d3dDevice->DrawPrimitive (D3DPT_TRIANGLEFAN, 0, 2);
Any help will be greatly appreciated, let me know if I missed anything.
Edit:
I am also using gimp, saving them with 100% quality
Edit Edit:
It appears to be the grass texture (or anything using the color key) just doesn't always draw a crisp image at the borders like the colorkey for transparency is just missing some of it.
[Edited by - yewbie on November 9, 2010 10:45:38 PM]