Jump to content
  • Advertisement
Sign in to follow this  

SetRenderStates for Points

This topic is 4445 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 have read through the SDK documents, I know in order to use point sprites, I have to set the following render states:
g_pd3dDevice->SetRenderState( D3DRS_POINTSPRITEENABLE, TRUE );
g_pd3dDevice->SetRenderState( D3DRS_POINTSCALEENABLE, TRUE );
g_pd3dDevice->SetRenderState( D3DRS_POINTSIZE, FtoDW(1.0) );
g_pd3dDevice->SetRenderState( D3DRS_POINTSIZE_MIN, FtoDW(1.0f) );    g_pd3dDevice->SetRenderState( D3DRS_POINTSCALE_A,  FtoDW(0.0f) );
g_pd3dDevice->SetRenderState( D3DRS_POINTSCALE_B,  FtoDW(0.0f) );
g_pd3dDevice->SetRenderState( D3DRS_POINTSCALE_C,  FtoDW(1.0f) );
What is the difference and purpose for D3DRS_POINTSCALE_A, D3DRS_POINTSCALE_B and D3DRS_POINTSCALE_C? The SDK document just says they controls the distance-based size attenuation for point primitives.

Share this post

Link to post
Share on other sites
You can find details of how they interact with each other in the SDK docs:

DirectX Graphics ->
Direct3D 9 ->
Programming Guide ->
Advanced Topics ->
Vertex Pipeline ->
Point Sprites ->
"Point Size Computations"

A is the constant factor, B is the linear factor and C is the quadratic factor that combined (see above) let you control the curve used to scale the point sprites.

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!