Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

vhalik

Fog and Particles

This topic is 5733 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I just added fog to my so called 3D engine, and my snow particles look like translucent squares than just snowflakes. Maybe it is the way I am blending the destination, but does anyone have any suggestions? Just before I render the particles: m_pD3DDevice->SetRenderState(D3DRS_ZWRITEENABLE, FALSE); m_pD3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); m_pD3DDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE); m_pD3DDevice->SetRenderState(D3DRS_POINTSPRITEENABLE, TRUE); m_pD3DDevice->SetRenderState(D3DRS_POINTSCALEENABLE, TRUE); m_pD3DDevice->SetRenderState(D3DRS_POINTSIZE, toDW(2.0)); m_pD3DDevice->SetRenderState(D3DRS_POINTSIZE_MIN, FtoDW 1.0f)); m_pD3DDevice->SetRenderState(D3DRS_POINTSCALE_A, FtoDW(0.0f)); m_pD3DDevice->SetRenderState(D3DRS_POINTSCALE_B, FtoDW(0.0f)); m_pD3DDevice->SetRenderState(D3DRS_POINTSCALE_C, FtoDW(1.0f)); I render the particles as D3DPT_POINTLIST

Share this post


Link to post
Share on other sites
Advertisement
what is your srcblend - as this dictates how it uses information from the texture fragment to render on screen.

If you are using alpha from the src and your snowflake texture has not got the correct alpha channel then it could well end up not drawn correctly.

You are definately setting the texture?

ie - find the most recent - try this:
m_pD3DDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE);

[edited by - Shrew on December 4, 2002 2:01:00 PM]

Share this post


Link to post
Share on other sites
The texture is being sent before I set the render state, but no where am I setting the alpha channel. Maybe this could be the problem?
Thanks for the help!

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!