About Q3's face_t & brush_t

hi all, I read q3 render pipe source
recently.Keep thinking about two questions
which always make my head ache. If anyone
can explain it to me I will be grateful so

as u know, face_t in q3 is :
typedef struct{

int lm_texnum;// lightmap info
int lm_offset[2];
int lm_size[2];

} face_t
what lm_offset[2] and lm_size[2] to do ?
I know it’s the location of face’s lightmap .
but what for ? caculate the dynamic
light use glTexSubImage2D ? how?

And brush_t, it record its faces’
info .plane’s dist and normal.
It should be used to collision detection?
but, only one side of a brush will be in
A LEAF. no need to caculate all brushes’
side in one leaf. I don’t understand.
Anyone know collision map in quake3 ?

For the second, I’m not sure.
But these int arrays will probably give the tex coords of the lightmap of a face, since I doubt q3 is using only one lightmap per light-texture, they’re somehow packed. That would be a glBind for every face if not packed…

lm_offset and lm_size is only needed to calculate the stuff for dynamic lightmaps(If you shoot a rocket for example).The only thing you need to to static lightmapping is
the lightmap index(which lightmap the face uses).The Lightmap-TexCoords are stored in the face´s vertices…The brushes are the boxes you see in the editor…And yes the brushes can be used for collision-detection.


[This message has been edited by XBCT (edited 01-21-2001).]

Oh, totally forgot to ask, where to get the q3 render code?

You aren’t going to be able to see the real Q3 rendering code unless you pay for a license and sign a NDA. However there are several open source graphics engines that render Q3 maps to varying degrees of quality and speed. None of these that I have seen have come close to the speed of Q3 however, well one came close but considering that Q3 also has the vm and sound to deal with, it was still too slow.

Okay. Where to pay?

Thank you very much! XBTC!
I thought it again these days.about lm_offset
and lm_size. In Quake1, every face stores
a textinfo which store two mapping texture
vectors :
typedef struct texinfo_s
float vecs[2][4]; // [s/t][xyz offset]

} texinfo_t;
It 's also used to caculated dlight .
But in Q3, there’s no texinfo anymore .Shader
does not have mapping texture vectors.
So Q3 must uses lm_offset and lm_size to
map the dlight from world coordinate to
2d mapping texture coordinate .Am I right?
If so, I 'd like to know how to use
glTexSubImage2D to get the dynamic light’s
lightmap to blend on to original faces…
In Q1, it recaculates very pixel in lightmap.
I don’t think it’s best method which q3
and unreal will use …

ps, i read titan. it’s speed is ok and
the method of walkthroughing bsp is from
q1 I think. and,who know how much is quake3
engine? I dont’ think small company can
burden it.

[This message has been edited by fuzzy3d (edited 01-22-2001).]

Sorry I cannot help your here ´cause I never looked into that dynamic lightmap stuff…
Anyway I gave you all info neccessary to do the static lightmapping(at least I think…
If you need some more info feel free to ask ).

Greets, XBTC!

I think Q3 stores many small lightmaps in several bigger textures in order to minimize texture swaps.
lm_texnum = BigTextureIndex
lm_offset[2] = Location in pixels of this lightmap
int lm_size[2] = Size in pixels of this lightmap

Yep you´re right Cem UZUNLAR…Q3 stores multiple lightmaps in one big texture…
It seems that your assumption is right but I never tried it so I can´t say for sure. However if you wanted to do dynamic lightmapping this info is all you would need(You would take the pixels specified by lm_offset and lm_size and multiply them by some value or do some other calcs on them).

Greets, XBTC!

[This message has been edited by XBCT (edited 01-24-2001).]