Jump to content
  • Advertisement
Sign in to follow this  

Particles are getting bigger...

This topic is 4499 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`ve just implemented my particle emitter class and all works fine but the particles are getting bigger when I move away my camera! I have set SetRenderState(D3DRS_POINTSCALEENABLE, TRUE); so my understanding is that the particle size is in world units. Even when I change it to FALSE I can't see any diffrence. Is this normal? Is there any way to change it? I tried to solve this with vertex shader but particles size outputed by VS is also scalled by DX. Please help:)(SDK February 2006)

Share this post

Link to post
Share on other sites
Yes i think the answer is somewhere there. But I just can't see why my particles using any combination of A, B and C (>1) are getting bigger when I move my camera away. According to this formula :Ss = Vh * Si * sqrt(1/(A + B * De + C *( D e2 )))
(Ss - output size in camera units, De - distance from camera, Si - input size)
I think they should shrink when De is getting bigger ,not the other way. Where do I make a mistake?

Share this post

Link to post
Share on other sites
Here is my code:

m_pD3DDevice->SetFVF(SIMPLE_PARTICLE_FVF); m_pD3DDevice->SetStreamSource(0,m_pVertexBuffer,0,sizeof(SSimpleParticleVertex));

m_pD3DDevice->SetRenderState( D3DRS_POINTSPRITEENABLE, TRUE );
m_pD3DDevice->SetRenderState( D3DRS_POINTSCALEENABLE, TRUE );

float fMinSize = 1.0f;//ma byc tak
m_pD3DDevice->SetRenderState( D3DRS_POINTSIZE, *((DWORD*)&m_fSizeMin)); m_pD3DDevice->SetRenderState( D3DRS_POINTSIZE_MIN,*((DWORD*)&fMinSize)); m_pD3DDevice->SetRenderState(D3DRS_POINTSIZE_MAX,*((DWORD*)&m_fSizeMax));
fMinSize = 0.0f;//ma byc tak
m_pD3DDevice->SetRenderState( D3DRS_POINTSCALE_A, *((DWORD*)&fMinSize));
fMinSize = 0.0f;
m_pD3DDevice->SetRenderState( D3DRS_POINTSCALE_B, *((DWORD*)&fMinSize));
fMinSize = 1.0f;
m_pD3DDevice->SetRenderState( D3DRS_POINTSCALE_C, *((DWORD*)&fMinSize));



Now as I look at it I think that the particles are not scalled and stays in camera units (so when I move away they seem to be getting bigger comparing to other objects) . But why? Is it some stupid mistake of mine?

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • 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!