Hey gang, Well, I went on a coding binge and this is the result. This patch does the following things:
1. Enables multitexturing, tested and working with Quake3 demo and UT. To get this to work, I had to switch the vertex setup functions in mach64_vb.c to pre-multiply the texture coordinates by the homogenous coord. This is how the utah-glx driver does it and it works. If someone can figure out how to get the card to do the multiply and get it to work for secondary textures, go for it. There still seem to be some blending/compositing problems here and there with multitexuring (the hanging vine textures on the first practice map of UT are an example), so that needs some investigating. What would be nice is a kind of combination of the multiarb and textenv demos. Any suggestions? 2. Enables fog (but only if alpha blending is off - hardware limitation of mach64). Currently, it just silently ignores fog being enabled when alpha blending is on, there's probably a better way to fallback. Tested and working with Nate Robins' fog tutorial and the Mesa fog demo. 3. Sets texture environment modes. I'm not sure this bit is totally correct, but the texenv Mesa demo seems to be working right. Note that I've set GL_BLEND to use software fallback. 4. The stuff in here on color masks is probably not necessary, as it's still done with software fallback. I just cleaned it up a bit as there was some vestigal r128 code there. I've played around with mipmaps, but without success thus far. The utah-glx code says that mipmapping is broken in RagePRO, can anyone confirm that this is a hardware bug? I'll have to check the Windows driver to see if it's disabled there. The attached patch should be applied in 'xc/lib/GL/mesa/src/drv/'. I don't have cvs write access, so if someone wants to set me up :) (sourceforge username: ldelgass), or apply this for me that would be great. I've merged the DRI trunk into my working tree as of the 4.2.0 release, so I could update the mach64 branch to 4.2.0 at the same time if I get cvs access. Then again, it might be better to wait until Frank opens a new branch for that. What do people think? As I said, it needs some conformance testing regarding blending modes, but it seems to be stable for me (and I can finally play quake and UT with lightmaps and multitexturing!). btw, there's a bug in the current CVS which this patch doesn't fix: in tuxracer, tux sort of flickers in and out (mostly out). This also happens with the lightcycles in gltron when alpha blending is turned on. I haven't figured out what's causing it yet. P.S. to Jos�: Thanks for applying the points/lines patch. -- Leif Delgass http://www.retinalburn.net
mach64-multitex.diff.gz
Description: mach64-multitex.diff.gz
