[quake2] quake flaw

Bobakitoo bobakitoo at qc.aira.com
Sun Oct 6 05:44:26 EDT 2002


On Sun, 6 Oct 2002 05:06:33 -0400 (EDT)
Vincent Cojot <coyote at step.polymtl.ca> wrote:

> On Thu, 3 Oct 2002, Bobakitoo wrote:
> 
> > i belive ther a desing flaw in quake2..
> >
> > R_DrawEntitiesOnList call R_DrawBrushModel for transparent model (window)
> > R_DrawBrushModel make somme transformation using R_RotateForEntity
> > R_DrawBrushModel call R_DrawInlineBModel
> > R_DrawInlineBModel add SURF_TRANS33 and SURF_TRANS66 to r_alpha_surfaces chain.
> 
> How did you notice that there was a problem.. did you use a debugger or
> just reading the source..?

the source. i did not see any in game visual artefact.

> > Once entities are "draw", R_DrawAlphaSurfaces called from R_RenderView() to
> > do the actual drawing of alpha surface. But at this point transformation
> > matrix has been Pop.
> 
> Can you tell us a bit more about the lins of code where this happens..?
> Just to know..
> 
this is the cutted version of what is call for every brush
model.

void R_DrawBrushModel (entity_t *e){
[...]
glPushMatrix ();
e->angles[0] = -e->angles[0];	// stupid quake bug
e->angles[2] = -e->angles[2];	// stupid quake bug
R_RotateForEntity(e); <-- Setup the transformation matrix
e->angles[0] = -e->angles[0];	// stupid quake bug
e->angles[2] = -e->angles[2];	// stupid quake bug
R_DrawInlineBModel(); <-- Add to the r_alpha chain in this function
glPopMatrix(); <-- Pop here
}

this one is a part of R_DrawInlineBModel function:

if (psurf->texinfo->flags & (SURF_TRANS33|SURF_TRANS66) ){// add to the translucent chain
	psurf->texturechain = r_alpha_surfaces;
	r_alpha_surfaces = psurf;
}
else{
	draw the brush model now
}

you can see that SURF_TRANS33 and SURF_TRANS66 are just linked the the alpha_chains.

Once all brush model had been "draw", it the r_alpha_surface chain turn.
R_DrawAlphaSurfaces is called as usual. it draw all world alpha surface
and bmodel. but matrix has been pop at the end of function R_DrawBrushModel.

-bob



More information about the quake2 mailing list