Skip to main content
GameDev.net gamedev.net
🔒 Locked

BSP and Texture Batching

Started by Gazza Oct 28, 2000 at 9:00 PM 3 replies 1k views
Original Post
Gazza
Gazza
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?
XBTC
XBTC
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!
Matt2000
Matt2000
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--

Check this out: Matthew Studios
Gazza
Gazza
Thanks Guys
mitchw
mitchw
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.