Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > 0b55f4054b6cfcfeaf8649a350a94879 > files > 30

Mesa-5.0-3mdk.ppc.rpm

You need to run in 15bpp, or the colours won't render correctly.
Easiest way is to put 'Weight 555' in the 16 bit Depth section in your
XF86Config.  

Texturing is working now.  Unfortunately the ViRGE doesn't have all the 
src/dest blending modes necessary for real OpenGL support.  I'll be doing
some bad hacks, I imagine, to try and get somewhat accurate support.
We'll see.  Bad hack number one is for GL_LUMINANCE textures.  I store
them in 4444 format, with the alpha being the value of the grey.  Otherwise
you see big black squares.  This could be wrong, I'll be pokin around.

We have lightmapping now!  It can be enabled with:
s3virge_lightmap_hack = 1
in your glx.conf.  

Basically, I setup another back buffer in video memory, and render lightmaps
to that.  Anything with GL_MODULATE is rendered into the regular backbuffer
normally and to the lightmap buffer as white triangles.  Anything with
GL_REPLACE and Z-buffering enabled is rendered somewhat similarly.  The
ViRGE has a 'complex reflection' texture blending mode for lighting
triangles wherein the two values are added together with a max of 1.  I
light the triangle in all white with a 0 alpha, and then blend the texture
on, so the lightmap buffer gets white bits for the numbers and such, but
just the numbers and not the square around them.  On swap, I read the back
buffer and the lightmap buffer from video memory (slow -- the fastest way
I've found is one big freaking memcpy, DMA might speed this up), blend the
two 'by hand' (Since the values are 5-bit, a lookup table for the multiplies
is only 1024 in size (4096 since I use 32-bit ints now, I think it's quicker
that way).. and write it out to the back buffer, and then blit.  The speed
hit isn't too bad on my machine, but we'll see how it is on a faster machine
where that read time might be more of a % of the time in a frame.