Archived

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

J_Vitel

Pointsprites per-point sizing

Recommended Posts

I''ve been taking a look on point sprites, and made a search on this forum, but I still wonder if someone succeded on a particle system wich allows per-point sizing* (each vertex has its own size) as well as alpha blend and other issues related to particle systems, I''ve been trying doing this, but I got tired of point sprites, so I wonder if they''re worth. I''m using this FVF and the size parameter seems to be ignored all the time
struct POINTVERTEX
{
    D3DXVECTOR3 v;
    D3DXCOLOR color;
    FLOAT size;
};
#define D3DFVF_POINTVERTEX (D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_PSIZE)
 

Share this post


Link to post
Share on other sites
Thanks, now I can scale them, however the acceptable range is from 0.000f to 1.50f is this OK?, my d3dcapsviewer said my maximum Point Size was 64 (?) and the alpha component of my color is being ignored

this is my FVF

struct MyPOINTSPRITE
{
FLOAT x,y,z;
FLOAT size;
D3DCOLOR color;
};
#define D3DFVF_MyPOINTSPRITE (D3DFVF_XYZ|D3DFVF_PSIZE|D3DFVF_DIFFUSE)


and this are my render flags

m_pD3DDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
m_pD3DDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_SRCCOLOR );
m_pD3DDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_SRCALPHA );


thanks.

Share this post


Link to post
Share on other sites
What about the texture stage states?
Have you set your alpha op to "select arg 1", and your arg1 to be
"diffuse"?

In general, I suggest:
- Reading all the docs about point-sprites (and about everything you want to do, also)
- Taking a copy of the point-sprite sample that comes with the SDK and play with the code until you become familiar with how point-sprites work.

Muhammad Haggag

Share this post


Link to post
Share on other sites