Transparent Ghost
How can I make my Ghost a little Transparent?
(DX8 and VB)
http://www24.brinkster.com/thunderstormweb/gallery/news004.jpg
try this way:
byezzzz
m_pd3dDevice->SetRenderState( D3DRS_ALPHABLENDENABLE,true); m_pd3dDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_ONE ); m_pd3dDevice->SetRenderState( D3DRS_DESTBLEND,D3DBLEND_ONE ); RENDER THE GHOST m_pd3dDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_ONE ); m_pd3dDevice->SetRenderState( D3DRS_DESTBLEND,D3DBLEND_ZERO );
byezzzz
Thanks, I have more pictures on the game at:
http://www.thunder-storm.tk (in swedish)
and
http://www24.brinkster.com/thunderstormweb/gallery/news001.jpg
http://www24.brinkster.com/thunderstormweb/gallery/news002.jpg
http://www24.brinkster.com/thunderstormweb/gallery/news003.jpg
http://www24.brinkster.com/thunderstormweb/gallery/news004.jpg
http://www24.brinkster.com/thunderstormweb/gallery/news005.jpg
http://www24.brinkster.com/thunderstormweb/gallery/news006.jpg
http://www.thunder-storm.tk (in swedish)
and
http://www24.brinkster.com/thunderstormweb/gallery/news001.jpg
http://www24.brinkster.com/thunderstormweb/gallery/news002.jpg
http://www24.brinkster.com/thunderstormweb/gallery/news003.jpg
http://www24.brinkster.com/thunderstormweb/gallery/news004.jpg
http://www24.brinkster.com/thunderstormweb/gallery/news005.jpg
http://www24.brinkster.com/thunderstormweb/gallery/news006.jpg
if you are building the models procedurally then just use an FVF with diffuse and vertex structures with ARGB components.
If you are using X files, you are going to have to use the CloneMesh call, which accepts as an argument a new FVF and vertex structure, replace the existing vertices with your new one and then do as blue chip said.
If you are using X files, you are going to have to use the CloneMesh call, which accepts as an argument a new FVF and vertex structure, replace the existing vertices with your new one and then do as blue chip said.
Just change the material, or make a nwe one, and use that
D3DMATERIAL9 mat;
memset(&mat, 0, sizeof(mat));
mat.Diffuse.r = mat.Diffuse.g = mat.Diffuse.b = 1.0f;
mat.Diffuse.a = opacity; // between 1 and 0
device->SetMaterial(&mat);
// use the above alpha blend thing bluechip said, except make sure you say TRUE instead of true (picky i know)
// render stuff
ahh... just saw you said VB - i dont know the exact calls, but look into materials. It should be very similar.
-Vulcan
[edited by - Vulcan on May 6, 2003 8:18:06 PM]
D3DMATERIAL9 mat;
memset(&mat, 0, sizeof(mat));
mat.Diffuse.r = mat.Diffuse.g = mat.Diffuse.b = 1.0f;
mat.Diffuse.a = opacity; // between 1 and 0
device->SetMaterial(&mat);
// use the above alpha blend thing bluechip said, except make sure you say TRUE instead of true (picky i know)
// render stuff
ahh... just saw you said VB - i dont know the exact calls, but look into materials. It should be very similar.
-Vulcan
[edited by - Vulcan on May 6, 2003 8:18:06 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement