🔒 Locked
Thruster Fire
Advertisement
Original Post
Hi - i''m looking for a way to make thruster fire.
I was wondering how this is done in games.
It needs to be semitransparent and needs to be scaleable ie - the higher your throttle, the longer the thruster engine fire goes out the back of the ship.
Should i use a semi-transparent mesh - if so, how do i do this.
Should i use volumetric lighting(not sure what this is) - if so how do i use this.
All help is appreciated.
Suggestion : Try using a particle system. There are a lot of tutorials about particle systems on the web.
An animated texture on a pyramid shape pointing out the back might work. You would need to set up a parameter for the length of the pyramid to simulate stronger fire. It should be alpha blended, and I suppose you could try rendering it front-face only OR back-face only, and see how that looks.
A flare at the center might not look too bad either (make it large when the flame is viewed head on and close, and smaller as the angle of view or distance increases )
[edited by - Waverider on October 31, 2002 3:29:28 PM]
A flare at the center might not look too bad either (make it large when the flame is viewed head on and close, and smaller as the angle of view or distance increases )
[edited by - Waverider on October 31, 2002 3:29:28 PM]
I have made a semitransparent cone in my 3d prg as an x object and loaded it but when i run my game its not transparent.
If it worked it would be perfect and that complictated particle system could be avoided. I might use it for when my ship explodes though....
Anyway - i would love to know why my loaded x file doesnt show up as semitransparent - is there any option that i have to enable?
this is what i''ve tried so far
g_pd3dDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
and
d3ddm.Format = D3DFMT_A8R8G8B8;
where am i going wrong.
If it worked it would be perfect and that complictated particle system could be avoided. I might use it for when my ship explodes though....
Anyway - i would love to know why my loaded x file doesnt show up as semitransparent - is there any option that i have to enable?
this is what i''ve tried so far
g_pd3dDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
and
d3ddm.Format = D3DFMT_A8R8G8B8;
where am i going wrong.
Beoch - i''ve figured it out.
just to let you know.
add
g_pd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
g_pd3dDevice->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_SRCCOLOR);
g_pd3dDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCCOLOR);
to the end of your function that initialised direct3d
just to let you know.
add
g_pd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
g_pd3dDevice->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_SRCCOLOR);
g_pd3dDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCCOLOR);
to the end of your function that initialised direct3d
If you want to use a texture with alpha blending.. here are the states to set (for just 1 texture stage)
//color operation
//to modulate the material and texture color do this:
SetTextureStageState(0,D3DTSS_COLOROP,D3DTOP_MODULATE);
//to just select the texture color do this:
SetTextureStageState(0,D3DTSS_COLOROP,D3DTOP_SELECTARG2);
//set the color arguments
SetTextureStageState(0,D3DTSS_COLORARG1,D3DTA_DIFFUSE);
SetTextureStageState(0,D3DTSS_COLORARG2,D3DTA_TEXTURE);
//alpha operation
//to select the alpha value from the material color:
SetTextureStageState(0,D3DTSS_ALPHAOP,D3DTOP_SELECTARG1);
//to select the alpha channel from the texture:
SetTextureStageState(0,D3DTSS_ALPHAOP,D3DTOP_SELECTARG2);
//set alpha arguments
SetTextureStageState(0,D3DTSS_ALPHAARG1,D3DTA_DIFFUSE);
SetTextureStageState(0,D3DTSS_ALPHAARG2,D3DTA_TEXTURE);
edit: by the way, these are in addition to what you already have there.
BH
[edited by - BrianH on October 31, 2002 6:37:12 PM]
//color operation
//to modulate the material and texture color do this:
SetTextureStageState(0,D3DTSS_COLOROP,D3DTOP_MODULATE);
//to just select the texture color do this:
SetTextureStageState(0,D3DTSS_COLOROP,D3DTOP_SELECTARG2);
//set the color arguments
SetTextureStageState(0,D3DTSS_COLORARG1,D3DTA_DIFFUSE);
SetTextureStageState(0,D3DTSS_COLORARG2,D3DTA_TEXTURE);
//alpha operation
//to select the alpha value from the material color:
SetTextureStageState(0,D3DTSS_ALPHAOP,D3DTOP_SELECTARG1);
//to select the alpha channel from the texture:
SetTextureStageState(0,D3DTSS_ALPHAOP,D3DTOP_SELECTARG2);
//set alpha arguments
SetTextureStageState(0,D3DTSS_ALPHAARG1,D3DTA_DIFFUSE);
SetTextureStageState(0,D3DTSS_ALPHAARG2,D3DTA_TEXTURE);
edit: by the way, these are in addition to what you already have there.
BH
[edited by - BrianH on October 31, 2002 6:37:12 PM]
opps - Beoch -
this doesnt really work - it only makes it semitransparent to itself - not to all other objects.
BrianH - error C2065: ''SetTextureStageState'' : undeclared identifier
i''m presuming i need to include something.
but nothing works
quote:
i''ve figured it out.
just to let you know.
add
g_pd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
g_pd3dDevice->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_SRCCOLOR);
g_pd3dDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCCOLOR);
to the end of your function that initialised direct3d
this doesnt really work - it only makes it semitransparent to itself - not to all other objects.
BrianH - error C2065: ''SetTextureStageState'' : undeclared identifier
i''m presuming i need to include something.
but nothing works
ok i added g_pd3dDevice-> to all of those settexturestage calls.
It runs but it doesnt work - its still not translucent.
It runs but it doesnt work - its still not translucent.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement