Original Post
Hi, I am trying to get the hang of particle systems. Now my particles do get rendered, however, they are rendered very big. Also their size does not increase or decrease no matter what parameters I put where. I do not understand the MSDN article about D3DRS_POINTSCALEENABLE, since I am no math professor. Also I have read that if D3DRS_POINTSCALEENABLE is set to FALSE that DX9 would just take the size declared in the vertexbuffer, however if I set it to false my particles are never rendered at all. I have other issues with my particles as well, but those are mostly logic errors/alogrithm going wrong, but my problem with the huge particle remains a mystery to me. I also dont know what else to try/what to read/look up to help my situation. below is some (hopefully) relevant code. struct CUSTOMPARTICLEVERTEX { FLOAT x, y, z; DWORD PSIZE; DWORD Diffuse; }; #define D3DFVF_CUSTOMPARTICLEVERTEX (D3DFVF_XYZ|D3DFVF_PSIZE|D3DFVF_DIFFUSE) /* since I dont know the real meaning of the following lines I just pass 0. However passing anything else does not change the results at all anyways*/ FLOAT MinSize, Scale; MinSize = Scale = 0; // setting up the particle system m_pDevice->SetRenderState(D3DRS_POINTSPRITEENABLE, TRUE); m_pDevice->SetRenderState(D3DRS_POINTSCALEENABLE, TRUE); m_pDevice->SetRenderState(D3DRS_POINTSIZE_MIN, *((DWORD*)&MinSize)); m_pDevice->SetRenderState(D3DRS_POINTSCALE_A, *((DWORD*)&Scale)); m_pDevice->SetRenderState(D3DRS_POINTSCALE_B, *((DWORD*)&Scale)); m_pDevice->SetRenderState(D3DRS_POINTSCALE_C, *((DWORD*)&Scale)); m_pDevice->SetStreamSource(0, m_pVB, 0, sizeof(CUSTOMPARTICLEVERTEX)); m_pDevice->SetFVF(D3DFVF_CUSTOMPARTICLEVERTEX); m_pDevice->SetTexture(0, m_Texture); m_pDevice->DrawPrimitive(D3DPT_POINTLIST, 0, m_NumParticles); if anybody could point me in the right direction or could give me some basic things I could check (things that have to be set or functions that have to be called when using a particle system etc) I would be very happy.