Jump to content
  • Advertisement
Sign in to follow this  
ParanoiaComplex

Problem with particle system

This topic is 5142 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

My particle system As you can see, my particle system doesn't blend. Anyone help me out here? I've tried and pulled my hair out for a long time about this. Should I just go to pointsprites, or is refilling the vertex buffer too costly each time for a large particle system? Am I using the right particle sprite too? Rendering code
		// Enable alpha blending
		// Turn it on
		g_pD3DDevice->SetRenderState(D3DRS_ZWRITEENABLE, FALSE); 
		g_pD3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); 

		g_pD3DDevice->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_SRCALPHA);
		g_pD3DDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVSRCALPHA); 

		g_pD3DDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_MODULATE ); 
		g_pD3DDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE ); 
		g_pD3DDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE ); 
		g_pD3DDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG2 ); 
		g_pD3DDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE ); 

		// Render all at once
		do
		{
			// Set the rectangle
			out.left = pCurrent->xPos;
			out.top = pCurrent->yPos;
			out.right = out.left + 32;
			out.bottom = out.top + 32;

			// Blt it using the global sprite engine
			test->BltSpriteEx(&out, NULL, NULL, D3DCOLOR_RGBA(255, 255, 255, 230), 0, NULL);
			pCurrent = pCurrent->pNext;

			count++;
		} while(pCurrent);

Share this post


Link to post
Share on other sites
Advertisement
Hey man, try this:

pDirect3D->GetDevice()->SetRenderState(D3DRS_ALPHABLENDENABLE, true);
pDirect3D->GetDevice()->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
pDirect3D->GetDevice()->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE);

Hope it helps.

~burst

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.

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!