Particle being rendered after everything else, but renders occluded

Started by
1 comment, last by codingsolo 16 years, 11 months ago
particle problem As seen in the image, the particle is being occluded by the model. The center point of the particle is his right hand. The particle is currently being drawn after everything else is rendered. ZEnable and ZWriteEnable are both true. Help me! Brandon
Advertisement
Since you have Z buffer tests and Z buffer writes enabled, the first and obvious question is: what are the Z values of the vertices of the particle sprite?

On a related note, if you're transforming the particle sprite yourself (e.g. from a vertex shader), what is the W of each of the vertices of the sprite?

I.e. is your Z causing the rasterized Z values of the sprite to be very far away compared to the character polygons.

A longer shot is are you doing anything with the stencil buffer? volume shadows on the character perhaps? If so, have you remembered to disable the stencil tests when rendering particles?


PIX is great for finding out what's going on with things like this; you can see the transformed sprite coordinates to find out if their Z is sensible, and you can check what's in the stencil buffer and which stencil state is enabled.

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

I'm assuming by the Z in your response you are always referencing the Z-buffer/W-buffer.

Using PIX, I was able to find the 6 vertices that I am sending into the shader to be drawn. I am only sending in an X,Y,Z ( along with color, tex coords, quad center point, and a rotation) in the vertex structure and can view the StreamSource just fine. I am not able to find out how to view the W component of the transformed vertex. Likewise, I am not able to view the stencil buffer surface.

Still working on it, though.

EDIT- Currently not doing anything with the stencil buffer for shadows or anything.

Depth surface rendered --



Brandon

[Edited by - codingsolo on May 24, 2007 7:49:54 PM]

This topic is closed to new replies.

Advertisement