Jump to content
  • Advertisement
Sign in to follow this  

Point Sprites

This topic is 5479 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 notice on alot of tutorials online (and the MSSDK) these renderstates are used:
pd3dDevice->SetRenderState( D3DRS_POINTSPRITEENABLE, TRUE );
pd3dDevice->SetRenderState( D3DRS_POINTSCALEENABLE,  TRUE );
pd3dDevice->SetRenderState( D3DRS_POINTSIZE,     FtoDW(0.08f) );
pd3dDevice->SetRenderState( D3DRS_POINTSIZE_MIN, FtoDW(0.00f) );
pd3dDevice->SetRenderState( D3DRS_POINTSCALE_A,  FtoDW(0.00f) );
pd3dDevice->SetRenderState( D3DRS_POINTSCALE_B,  FtoDW(0.00f) );
pd3dDevice->SetRenderState( D3DRS_POINTSCALE_C,  FtoDW(1.00f) );

the only disadvantage is that this assumes a constant point size. I am trying to make the point sprites change in relation to the camera distance, so as the camera moves away, the sprites get smaller. I'm using the FVF "PSIZE" and my struct looks like this:
struct VertexPointSprite
	D3DXVECTOR3 vecVert;
	float fSize;
	DWORD dwColor;
	static const DWORD FVF;

as of right now, the point sprite is always the same size irregardless and when i tried using the scale a, b, and c's the point sprite was the size of a few pixels, even when the size of the point sprite was 2000. thanks

Share this post

Link to post
Share on other sites
Try setting point scale C to 1.5. Pointscales are like the attenuation values for light sources. And if you still dont see any changes it might be because of lack of hw support. Try switching to software vertex processing and see if it works then.

On a similar note I've written a tutorial on pointsprites over here and the sample does change scale relative to camera distance, so you can compare that with your code and see what needs to be changed.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!