-
Transparent stuff!?
Hey everyone!
My latest dilema is making a texture in Directx8 transparent. Not like a mask type of thing where one color you cant see, I mean like I want the whole surface to be slightly transparent. Is that like alpha blending or some needlessly complex thing like that? Anyhoo- no matter what it is- how do ya do it!?
-
Did you use a transparent texture (like TGA w/ alphachannel)?
-
Give the vertices of your object a color (RGBA) with RGB white (to show a normal texture) and A (=alpha) a value for the transparency of that vertex.
Code:
D3DColorMake(R, G, B, A) 'with each ranging from 0 to 1
'or
D3DColorRGBA(R, G, B, A) 'with each ranging from 0 to 255
'and don't forget to turn alpha blending on
objD3DDevice.SetRenderState D3DRS_SRCBLEND, D3DBLEND_SRCALPHA
objD3DDevice.SetRenderState D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA
objD3DDevice.SetRenderState D3DRS_ALPHABLENDENABLE, True