Jump to content
  • Advertisement


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


DX8 Point Sprite Support

This topic is 5767 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''m still using DX8, and I was modifying the ''PointSprites'' sample code that comes with the sdk. Basically, I''d like to be able to specify the size of the point sprite in the FVF vertex buffer just like the documentation says you can. However I have been very unlucky... //I changed the vertex format from: struct POINTVERTEX { D3DXVECTOR3 v; D3DCOLOR color; }; #define D3DFVF_POINTVERTEX (D3DFVF_XYZ|D3DFVF_DIFFUSE) //TO: struct POINTVERTEX { D3DXVECTOR3 v; float size; D3DCOLOR color; }; #define D3DFVF_POINTVERTEX (D3DFVF_XYZ|D3DFVF_PSIZE|D3DFVF_DIFFUSE) // Before I process the vertex buffer, I have (unmodified from // sample code) : 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) ); ... and so I haven''t changed the sample code except for adding a float value to the vertex format which the documentation says will work. I thought the documentation said if I specified a per vertex point sprite size, the D3DRS_POINTSIZE value would be ignored, and the size that was passed in would be evaluated and scaled appropriately. Now, it says untransformed and unlit vertices mean the size will be interpreted in camera space, and transformed and lit vertices mean the size will be interpreted in screen space. By specifying untransformed (D3DFVF_XYZ), but lit (??? by virtue of a lacking D3DFVF_NORMAL value ???), am I screwing something up? I''m guessing I have the last part of this paragraph misunderstood. Anyway, I can modify the point sprite''s view space coordinates and color just fine. I can see the point sprites just fine. I can modify D3DRS_POINTSIZE, and the size of the point sprite will change. I can comment it out, and I will get some default size. I can change the scaling values A,B, and C and it will affect the size. Just about the only thing that won''t affect the size is the extra float value I am passing through which is supposed to! Obviously I am missing something big here - I am very much in need of someone''s expertise right about now, and would greatly appreciate any help whatsoever. Thanks a lot, Geronimo

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!