Jump to content
  • Advertisement
Sign in to follow this  
darc koder

Frustum Culling: No. of Polygons drawn

This topic is 2544 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'm trying to implement frustum cull techinque in the vertex shader itself. What i'm trying to do is, only pass those vertices to the pixel shader which lie in the frustum cone. But the problem is i dont know how to get the number of polygons drawn so as to see if the technique is working or not, whenever i move the camera. I'm using a really fast GPU so i dont think a few polygons will affect the fps count so i don think i can use fps count so as to check the performance gain

What i wanna know is there any function or technique to query the number of polygons or tris drawn on the screen.

I'm working in C++ using DirectX and HLSL.

Share this post


Link to post
Share on other sites
Advertisement
You are not actually doing anything. The GPU already culls any triangle that turns out to be outside the view frustum, faster than you could ever do it in a shader, right before the pixel shader stage. So you are effectively not doing any work. Frustum culling is done on the CPU side, not triangle by triangle obviously but either by big chunks of triangles (test the bounding box of those triangles, and if this bounding box is outside the frustum you don't even need to send all those triangles to the GPU via a draw call since they will end up off the screen), or via a quadtree/octree for maximum performance. The only point of frustum culling is to avoid sending the vertices to the GPU in the first place, along with doing useless vertex shader work for those vertices which won't end up being filled.

On topic however, you are trying to query the pipeline statistics of your GPU, which return information such as number of vertices sent to the GPU, number of vertices rasterized, number of pixels filled, etc... you should be able to find some code examples now that you know the keywords.

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!