Sign in to follow this  
Zeir

Counting drawn faces

Recommended Posts

Zeir    122
Hey :) this is probably a little silly but i havent managed to find out how to do this, so here goes: basicly what im trying to do is count the faces (and/or vertices) that are actually being drawn (that is the ones that pass the culling etc..) i have a model loaded into a ID3DXMesh, and i use DrawSubset to draw it, the only face count i managed to get is using GetNumFaces, but that returns the number of faces in the mesh, not the ones that get drawn. any help will be appriciated, thanks :)

Share this post


Link to post
Share on other sites
Supernat02    604
Did you write software to cull parts of the mesh? The pipeline will throw some out if they are out of view, but I don't think there is a way to know how many.

Chris

Share this post


Link to post
Share on other sites
Zeir    122
well for now i turned on the D3DRS_CULLMODE RenderState, it cuts out some of em, im just trying to figure out how many faces are actually getting drawn.
seems logical to me that there will be an easy way to do this, i just cant seem to figure out how.

Share this post


Link to post
Share on other sites
Kibble    504
Check this out. You want D3DDEVINFO_D3DVERTEXSTATS.

You have to put the device in software TL for this query to work:
Quote:
from msdn:D3DDEVINFO_D3DVERTEXSTATS reports the number of triangles that have been processed and clipped by the runtime's software vertex processing. Use the debug runtime and software vertex processing to get the number of non-clipped and clipped primitives for a particular scene. Primitives will typically be clipped based on a guard band (if one is present). The clipping guard band is set with parameters such as GuardBandLeft in D3DCAPS9.

Share this post


Link to post
Share on other sites
Zeir    122
im not sure if this isnt the right way to do it, or maybe im using the interface wrong, but my models face count is 6901,
and the query returns 6905, the odd thing is it's returning 6905 when i set the culling Renderstate both to NONE and to CCW.


maybe im not using it the right way, ill keep trying ;)

Share this post


Link to post
Share on other sites

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