
07-26-2011, 06:07 PM
|
|
Newcomer
|
|
Join Date: Jul 2010
Posts: 1
|
|
Texture with colorkey over opaque texture - multitexturing
|
Hi. I'm driving mad searching for this procedure. All what I found is playing with alpha blending.
What I want is: 1 square (two triangles). One opaque texture, and another texture of the same size that uses colorkey to male certain parts transparent.
I load my textures:
Function TextureLoad()
'El color transparente
TransparentCol = &HFFFF0000 'RGB(255,0,0)
Set Texture2 = D3DX.CreateTextureFromFileEx(D3DDevice, App.Path & "\unit.bmp", D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, D3DFMT_UNKNOWN, D3DPOOL_MANAGED, D3DX_FILTER_NONE, D3DX_FILTER_NONE, TransparentCol, ByVal 0, ByVal 0)
Set TerrTex04 = D3DX.CreateTextureFromFile(D3DDevice, App.Path & "\textures\grassland04.bmp ")
End Function
And then I try to render using stages:
D3DDevice.SetTexture 0, TerrTex04
D3DDevice.SetTexture 1, Texture2
D3DDevice.DrawPrimitiveUP D3DPT_TRIANGLESTRIP, 2, TriStrip(0), Len(TriStrip(0))
But I don't know what opcions to use to show this effect.
Anyone could help? Thanx in advance
|
|