Jump to content
  • Advertisement
Sign in to follow this  

Problem with particle system

This topic is 5418 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->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
			// 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;

		} while(pCurrent);

Share this post

Link to post
Share on other sites
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.


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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!