Title: Q3 texturing issue solved (sortof)

Related to the texturing problem in Quake3 I mentioned a few days ago...

It turns out that this line in fxvsetup.h is the culprit:

#define DO_SETUP_W { (v)->oow=wscale*win[i][3]; }

Scaling by wscale seems to be causing rather nasty precision problems.
Where this shows up is when you have a "relatively" close far clipping plane as compared to the size of the rest of your coordinates. If you remove the wscale factor, the whole problem with texture alignment goes away.  I'm not going to claim to be a major OpenGL expert so I'm not sure if doing that will really hose anything, but Quake3 seems to run fine with the change (no depth buffer issues I could

see) and all of the textures wind up correct.   FWIW, we don't do scaling like this in our OpenGL ICD and just pass the standard W value straight through to the hardware.

Also worth mentioning, it may be worthwhile on Voodoo2 and later chipsets to switch to 2X2 dithering in Glide.  This helps eliminate the infamous "tire treads" you

see with lots of multipass rendering, especially in the rocket smoke trails
in Quake3.  This is somewhat of a subjective call, but it is also something we have done internally.

And related to smoke trails... if you report less than 16MB of video/texture
memory via the AGL interface, Quake3 on the Mac will fall back to "Rage Pro"
mode for drawing smoke trails and they look incredibly bad.  I hacked my
version of Mesa to report 16MB and everything looks *much* better now,
especially in combination with a forced 2X2 dither matrix.

I don't have CVS write access so someone else will have to make any/all of
the above changes.

-Kenneth

Reply via email to