Transparent Ghost

Started by
10 comments, last by gustav 20 years, 11 months ago
How can I make my Ghost a little Transparent? (DX8 and VB) http://www24.brinkster.com/thunderstormweb/gallery/news004.jpg
Advertisement
try this way:


  	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
Cool models

.lick
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
but, I need to set the ARGB value...how can I do that?
Hey, who is BRINKSTER ?

Please AGREE or I will LIBERATE you
Use the D3DXCOLOR_ARGB(a,r,g,b) macro to create a DWORD color, with transparency.
Peon
Yes, but how can I add that to my mesh-object?
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.
"Let Us Now Try Liberty"-- Frederick Bastiat
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]

This topic is closed to new replies.

Advertisement