Sign in to follow this  

D3DXSprite instead of textured quads for particles?

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

I wonder, instead of going through the trouble of using textured quads for a particle engine, could I just use D3DXSprite instead? It is much simpler, built-in, and simply works. Would it be possible to render the scene without particles, then use some kind of depth-testing to render the sprites as behind or in front of geometry in the scene?

Share this post


Link to post
Share on other sites
In the ID3DXSprite::Begin call there are a number of flags that can be set. You'll need D3DXSPRITE_OBJECTSPACE to render in 3D and probably D3DXSPRITE__BILLBOARD as well. I'm not sure what that last part was about custom depth testing, sprites rendered in object space use the same Z-Buffer as everything else.

[Edited by - Scet on November 6, 2006 7:52:49 PM]

Share this post


Link to post
Share on other sites
The depth-testing thing was because I thought that, once the scene is rendered the particles would just be drawn on top regardless of depth (above or behind another object)?

Share this post


Link to post
Share on other sites
The ID3DXSprite.Draw call takes a D3DXVECTOR3 which includes a z component. Like I said, when you draw the sprites in object space, it renders as if it where a normal 3D-quad. There's no need for any special depth-testing, just use the z-buffer as you normally would.

This is a 3D scene right? I've been assuming it's 3D, but it would be nice if you mentioned what it actually was.

Share this post


Link to post
Share on other sites
Ah, yes, it is a 3D scene.

So, basically, I can render all my meshes, and then after that just make the calls to ID3DXSprite to draw all the particles in the world, and when I Present() occlusion will be working fine?

If so, this makes things extremely easy.

Share this post


Link to post
Share on other sites

This topic is 4060 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this