Archived

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

Gazza

BSP and Texture Batching

Recommended Posts

I was just wondering, we all know that batching textures is the best thing to do for speed purposes but i cant really imagine how this is possible with a BSP Tree. Does anyone know how Quake batches its textures.I suppose you could batch the polygons in an actual leaf but that wouldnt be much help as you would still have lots of leafs to render. Any ideas anyone?

Share this post


Link to post
Share on other sites
In Q3 for example the BSP is only used to determine quickly which faces are visible(Inside the view frustum,....) and the z-order of the tree is ignored.Which means you just check which faces are visible via bsp and then sort them by texture\shader(It is enough to sort the face array once and not during runtime).
Only for alpha-blended(transparent) surfaces the z-order is used.

HTH,XBTC!

Share this post


Link to post
Share on other sites
Hi Gary

First of all, I don´t know how the q3a engine works exactly, I think it works like this.
Quake3 handles textures as shaders. A shader is a texture including its lightmap and bump mapping,.... . Before actual rendering, it culls every polygon that´s not visible. Then it puts every polygon into a shader tree,(I hope you can imagine what this is)because it wants to optimize the connection between cpu and graphic card. Then he renders the whole tree. The problem about it is that you can´t draw front to back anymore, so you have the old problem of pixel overdraw. Maybe, if oyu use a nice clipping algorithm, and over draw is less than 1.5 then it´s worth it.

--Matthias Liertzer--

Share this post


Link to post
Share on other sites
Yeah,basically you go through the BSP tree ( with PVS ) and mark the faces that are visible. Then you go through the global face list (that is sorted by texture) and render the ones that are marked.

Share this post


Link to post
Share on other sites