Q3bsp2 - map loading changes


(martinhoge) #1

Hi,
this problem may be discussed here earlier, but I havent found
that. Some tome ago I’ve done engine, which used q3 bsp files created
with q3map bsp compiler. Everything was ok. Now, I’ve started to use
new radiant with q3map2 bsp compiler. But I have problems with its loading.

Before I used GL_TRIANGLE_FAN to display face. Now I cannot use that.
Some of triangle faces are GL_TRIANGLE_STRIP, but some not.

Some of face’s verticles are stored in this order:
4_____1



3_____2

As in q3map , so I can use GL_TRIANGLE_FAN, because it draws triangle 1-2-3
and then 1-3-4 …

In q3map2 it is this way:
4______3



2______1

So I would use GL_TRIANGLE_STRIPS to draw: 1-2-3 and 2-3-4, if it was the same
for all faces !!! because for some faces it is:
4_______1



2_______3

What is the reason of it? How can I overcome this problem? I tried to do some
resarch, find some extra flags in faces or vertices, but it is not successful, I haven’t
found any rule why it is so.

If you know something about it, please let me know

Thanks

         Martin

(Shaderman) #2

Maybe this is useful for you (or maybe I got you totally wrong :D):

4.4.4 The List of Edges

This structure stores indexes of edges, possibly inverted, so that faces can be reconstituted.

short lstedge[numlstedge];

All the edges in a face are stored consecutively, with the correct orientation so that all the vertices in the face are walked clockwise.

But since the edges are used for more than one face, there is a trick to ensure that the edge of a given face is always referenced with the correct orientation:

* if lstedge[e] is positive, then lstedge[e] is an index to an Edge, and that edge is walked in the normal sense, from vertex0 to vertex1.
* if lstedge[e] is negative, then -lstedge[e] is an index to an Edge, and that edge is walked in the inverse sense, from vertex1 to vertex0. 

The fact that all edges are walked in a clockwise order is critical for the face rendering process (rasterisation).

The faces are made of just one closed set of edges, or contour. Those edges seem to be always stored in the right order.

Taken from the The Most Unofficial Quake Technical Specification. I don’t know how old this document is and whether q3map2 creates the bsp this way or not.

Shaderman


(Detoeni) #3

Taken from the The Most Unofficial Quake Technical Specification. I don’t know how old this document is and whether q3map2 creates the bsp this way or not.

…This document is Copyright © 1996…

I think its for quake (the first one).


(ydnar) #4

All triangle surfaces (brush or model) in a Q3Map2 BSP are indexed triangles. The brush faces are tesselated and surfaces are stitched together from the resulting triangles, which can be in any order.

Short answer: Don’t use triangle fan/strip to render those surfaces, use indexed triangles.

y