i was looking hrough the Irrlicht source recently and i saw something weird in the Q3 BSP loader. the line was
for(i = 0; i < (numtextures+1)*(numlightmaps+1); i++)
then the code inside sets up a bunch of mesh buffers to hold geometry.
Why is this code like this? it seems that it would be allocating lots of unnecessary mesh buffers then calling lots of unnecessary code for rendering them. Wouldn't it be easier to get the amount of meshes from the BSP file? (# of meshes == # of brushes, i think)
weird code in BSP loader
I'm not familiar with bsp file format, but Irrlicht needs a mesh buffer for every different material (generally texture). I have never really ever learned exactly what Q3 brushes are, but one could definitely have multiple brushes with the same texture (thus allocating meshbuffer for every brush could actually be wasteful) and it may be possible to have multiple textures on a single brush (I just don't know if bsp format allows this).
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.
Crucible of Stars
Crucible of Stars
i just realized this as you were posting. i was thinking that irrlicht's BSP loader created a mehbuffer for each object (which would be a brush) in the level yet in reality it creates a meshbuffer to hold a polygon soup of every face with a certain texture/lightmap.
wow, i just realized how inexcapably terrible BSPs are. building my own level format has definately taken a step up in my game's priority
wow, i just realized how inexcapably terrible BSPs are. building my own level format has definately taken a step up in my game's priority