On 2/22/07, Per Inge Mathisen <[EMAIL PROTECTED]> wrote:

On 2/22/07, The Watermelon <[EMAIL PROTECTED]> wrote:
> 3.another odd issue that kills the performance is that you cannot add
> polygons of a shape to a triangle list and draw the list instead of
> the polygons separately,because the shape will be very facked up if you
> so,maybe the pie's by pumpkin didnt use triangle face(which is used in
> almost all rts games) when creating models...

Yeah, it looks like they screwed up polygon facing for non-terrain
polygons. Take a look at the comment in pie_DrawPoly() in
lib/ivis_opengl/piedraw.c. Backface culling is on by default, but
whenever a regular pie is drawn, it is turned off first...

The attached patch should make the code easier to understand and
optimize. (BSP_BACKFACECULL is never used. I wonder what it was meant

- Per

pie_DrawPoly() name is confusing actually it's the pre-drawTriangle function
for terrain tile only,other regular polygons(whether triangle or not) are
drawn using pie_Polygon.

the BSP was supposed to replace the z buffer,though it seems they didnt have
the time to finish it.I think the bucket3d is doing the z depth stuff,or at
least it sorts the objects to draw from 'far' to 'near'.

I think they had a pie_clockwise check in 1.10 source to cull the
backface,though it seems the function is obsolete in current source
now.maybe the opengl backcull face functionality is not suitable for wz,so
that lot of time is wasted on drawing backface stuff and enable/disable
opengl states,original backcull code in pie_drawPoly:(I think this is still
usable in our code and it should eliminate some chunks of overhead by opengl
state change and backface drawing)

if(((aVrts[1].sy - aVrts[0].sy) * (aVrts[2].sx - aVrts[1].sx)) <=
((aVrts[1].sx - aVrts[0].sx) * (aVrts[2].sy - aVrts[1].sy)) )
 bClockwise = TRUE;

seems the terrain draw calls a special sets of functions (fastDrawTriangle
and fastClippedTriangle) to optimize the performance of terrain
drawing,though all of those seemed to be dropped into d3d/glide port to
Warzone-dev mailing list

Reply via email to