Archived

This topic is now archived and is closed to further replies.

Reducing the number of draw calls in BSP rendering

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

Currently I'm using Quake3 format BSP maps for my engine/game. My rendering method is basically (straight out of code):
	//First of all, we determine visibility for ALL leafs
	//Second, we mark visible faces from each leaf
	//Third, we draw the visible faces
  
Ok, so each face only gets drawn once. Now the problem is, because the number of edges to each face is irregular, and each one is it's own fan, I end up making a draw call for each and every visible poly. While this is not a huge number, it's still quite unacceptable. I'm wondering if there's anything I can do to reduce the number of draw calls to a more reasonable number than 650 (current average)? I was thinking something like, oh maybe, just one call? [edited by - Promit on October 10, 2003 4:17:35 PM]

Share this post


Link to post
Share on other sites
i wrote a renderer, the bsp class compiled the polys into a list
and the renderer sorted then pushed them all out to the screen
in a few calls (like 10ish)

thats the way to go.. recreate the polylist per frame into
your own format and then you can do anything you like with
them. even bake a cake.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
The secondary vertex list of a face (the one you need to use with the mesh type faces) in a polygon type face is actually a triangle list. Place those into a render list and sort by shader.

Share this post


Link to post
Share on other sites
It is much more advantagous to draw many indexed triangles in one draw call than draw a few triangle fans in many draw calls. Batch, batch, batch, is the current optimization mentality.

My BSP renderer averages about ~60 calls / frame (1 call per visible shader pass per frame), depending on the map. It''s not obvious how to further lower that number, nor is it obviously worthwhile.


Mike

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
The secondary vertex list of a face (the one you need to use with the mesh type faces) in a polygon type face is actually a triangle list. Place those into a render list and sort by shader.


Wait...what is that mesh stuff, exactly? I never used it...it''s really just a tri list of the same data?

Share this post


Link to post
Share on other sites
quote:
Original post by Promit
Wait...what is that mesh stuff, exactly? I never used it...it's really just a tri list of the same data?


Yeah it is. If I remember correctly, it is a tri list, not indexed triangles.

[edited by - RollingRock on November 2, 2003 4:44:28 PM]

Share this post


Link to post
Share on other sites