Skip to main content
GameDev.net gamedev.net
🔒 Locked

particle system doesn't work with effect file!

Started by tiger54 Oct 19, 2004 at 11:21 AM 0 replies 650+ views
Original Post
tiger54
tiger54
Hi! I wrote a system with an effect file. I added a a particle system but I can't see any particles :( I think the problem is that I use an effect file and DX9 want it to render all the scene, is it possible? Like in the DX9c examples I render my objects in this way: m_pEffect->SetTechnique( hRenderScene ); m_pEffect->Begin( &cPass, 0 ); for( p = 0; p < cPass; ++p ) { m_pEffect->BeginPass( p ); for( DWORD m = m_Mesh.m_dwNumMaterials-1; m<10; --m ) { m_pEffect->SetTexture( hTexture, m_texture ); m_pEffect->CommitChanges(); m_Mesh.GetLocalMesh()->DrawSubset(m); } m_pEffect->EndPass(); } m_pEffect->End(); And it works! But when I want to draw a particle I use this function: pd3dDevice->SetRenderState( D3DRS_POINTSPRITEENABLE, TRUE ); pd3dDevice->SetRenderState( D3DRS_POINTSCALEENABLE, TRUE ); hr = pd3dDevice->DrawPrimitive( D3DPT_POINTLIST, m_dwVBOffset, dwNumParticlesToRender) And I can't see any particle! Is there a way to draw particles in the effect file?
Supernat02
Supernat02
I think you were just showing us the effect file as a point of reference, because I'm not sure how it fits in with the particle code you showed below it. Nonetheless, can you show the code used to create the point sprites? Also, check your hardware caps in the DXCapsViewer utility to verify that your card supports point sprites. The max point size should be greater than 1.

Also show how you are creating the vertex buffer that holds the point sprites, what the vertex declaration is, etc. And lastly, we need to see the code that renders it. I think then we can help.

Good luck,
Chris
Chris ByersMicrosoft DirectX MVP - 2005

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.