VOGONS


First post, by truth_deleted

User metadata

A very fast software opengl rasterizer is the Mesa3D llvmpipe driver. It is cross-platform and relies on multithreading and "x86 JIT code generation" to achieve optimal performance, perhaps an order of magnitude lower as compared to a typical opengl video card (verified in ioquake3 in WinXP).

Also, built the alternative Mesa3D swrast driver, also a software rasterizer, which does not have the above optimizations. However, the swrast driver in Mesa3D, version 6.4.2, was slow while running ioquake3 on a Core2Duo at its lowest settings (320x240, bilinear filtering, extensions off, lowest texture and geometric settings, vertex lighting; sound quality low). Changing parameter values in config.h of the mesa3d package did not have a significant impact on speed. Later 6.x versions of Mesa3D did not build in MinGW-32bit, while 7.x and later are not adapted for mingw.

However, edits to a Makefile allowed a build of the Mesa3D swrast driver for version 6.5.3. This driver was significantly and surprisingly faster than 6.4.2. Attached is a recent win32 version of ioquake3 which I built, along with two copies of the swrast driver 6.5.3 (opengl_X.dll), and the optional patch to build Mesa3D 6.5.3 via mingw. The two versions of the driver include one optimized for SSE (also x86 asm, 3dnow instructions) and the other without these optimizations, so the latter may run on an older CPU; at least as old as permitted by mingw32/gcc4.6.2. Ioquake3 + swrast may be useful on a Pentium 4, but I haven't confirmed this. Additional settings for optimal speed include a setting in quake3, r_texturemode=gl_nearest, and a Windows environmental variable, MESA_NO_DITHER=1.

Attachments

  • Filename
    ioq3.zip
    File size
    3.1 MiB
    Downloads
    314 downloads
    File comment
    ioquake3 + software rasterizer (win32)
    File license
    Fair use/fair dealing exception

Reply 1 of 10, by leileilol

User metadata
Rank l33t++
Rank
l33t++

What about integration with it's own renderer module instead of trying to piggyback over the existing OpenGL renderer module? Like this?

should also mention r_textureMode doesn't override the filter mode of the 2d graphics, you'd have to apply more changes to get those to nearest for the software rasterizer, changes like this

finally mesa rasterizer is nowhere at the speed of sgi opengl for windows so it's not very useful for P4, even the SSE version.

apsosig.png
long live PCem

Reply 2 of 10, by truth_deleted

User metadata

I couldn't test the sgi opengl for windows, at least the version from cosmo player, since it is not compatible with my ioquake3 or quake3 binaries. Also, I couldn't find the complete source code for building the sgi opengl binary in windows.

The mesa3d software rasterizer, version 6.5.3, produced good frame rates in a slow Core2Duo, at least by my benchmarking in one computer system. It was within a factor of the llvmpipe driver, an impressive result given the latter's capabilities. I would be interested in finding benchmarks among 3d games which contrast the different software rasterizers and also the influence of high versus low graphical settings.

I will try your patch to optimize the speed further by altering the filtering mode. I expect it to produce good results with the mesa3d driver.

Reply 3 of 10, by leileilol

User metadata
Rank l33t++
Rank
l33t++

That patch was more in line with the SGI driver. It also should turn off perspective correction and goraud shading for additive blended effects, just to save some software processing

apsosig.png
long live PCem

Reply 4 of 10, by truth_deleted

User metadata

Attached is an updated "opengl renderer" binary, which includes an adaptation of leilei's code to optimize the texture filtering for performance in-game.

Attachments

  • Filename
    patch_textureMode.zip
    File size
    373.33 KiB
    Downloads
    171 downloads
    File comment
    patch to enforce gl_nearest (by leilei)
    File license
    Fair use/fair dealing exception

Reply 5 of 10, by Stiletto

User metadata
Rank l33t++
Rank
l33t++
truth5678 wrote:

I couldn't test the sgi opengl for windows, at least the version from cosmo player, since it is not compatible with my ioquake3 or quake3 binaries. Also, I couldn't find the complete source code for building the sgi opengl binary in windows.

I have also not had much luck with the Cosmo Player version of the SGI OpenGL DLL, leileilol...
Re: The Wrapper Collection Project

"I see a little silhouette-o of a man, Scaramouche, Scaramouche, will you
do the Fandango!" - Queen

Stiletto

Reply 8 of 10, by truth_deleted

User metadata

Compiled quake3 (v. 1.32b) from the original source code release, instead of ioquake3. Also, examined source code and located source of the "pixelformat" error where running the software rasterizer. This error is avoided by setting a CVAR variable on starting quake3 (quake3.exe +set r_allowSoftwareGL 1). This will allow quake3 to work with the software rasterizer (opengl32.dll) which is included in the archive (ioq3.zip) posted in this thread. Setting 320x240 results in playable gameplay speed for a fast P4 system. Perhaps the modification for "gl_nearest" would help target a slower computer system. In any case, this will allow an older Windows operating system to run a software rasterizer with quake3, particularly the ones which do not support the ioquake3 binary. 😀

It should also allow benchmarking among the software rasterizers. I can post my quake3 binary, if requested. I believe it was compiled with the appropriate compiler optimizations.

Since this method is not tied to a single video card, it is possible to run multiple instances of quake3 at the same time.

Reply 10 of 10, by truth_deleted

User metadata

Win32 software rasterizer by SGI is not fully open source, but located their binary (v. 1.1.1.0): http://www.cs.uml.edu/~hmasterm/Environments/ … nvironment.html. From limited testing, it doesn't seem significantly faster than the Mesa3d rasterizer (Quake3 at 320x240). The Mesa3d software rasterizer also seems to have better mouse input response.

The "gl_nearest" setting has a significant effect on gameplay speed (in some cases ~2x). Upon request, I'll post a quake3 binary which includes this setting. That should allow for playable speeds on somewhat slower computer systems.

The other setting is to start quake3 as follows so the software rasterizer (mesa3d opengl32.dll in above archive, ioq3.zip) is functional: quake3.exe +set r_allowSoftwareGL 1

Note: as leilei mentioned, the mesa3d software rasterizer opengl32.dll may be renamed, such as to opengl32-MESA.dll. Then, add a setting to the quake3 shortcut so that the renamed dll is used: +set r_glDriver opengl32-MESA.dll