Radiosity Comparison


(duralisis) #1

I’ve done a comparison between Q3Map2’s radiosity implementation, Half-Life’s (with Zoner’s compile utilities), and a Blender3D’s render quality “pseudo radiosity”.

I did this by rigging up a simple scene that is well known for measuring simulated lighting, the Cornell box. (More info here: http://www.graphics.cornell.edu/online/box). First I made a simple Q3 map with an area light. Then I duplicated this scene exactly in Valve’s Hammer editor (with custom textures and a custom rad file for the light). Finally, I recreated the scene unit per unit accurately in Blender3d (2.27), compiled everything, waited, rendered out the scene and wa-la!

The results are interesting:

Blender3d

Using the default radiosity settings and gour shading mode, this calculated very quickly. Nice subtle colors all around. Good soft shadowing (well good enough for vertices, as blender calculates a mesh from a hemicube if I recall correctly).

Half-Life

This compiled lightning quick using -extra, -smooth 90, and -bounce 128 (overkill, but very smooth). I’ve always been impressed with Half-Life’s lighting. Easy to get great looking results with a custom .rad file for ZHLT.

Finally…

Quake 3

Used q3map2 v2.5.4 and these settings:


-bsp 
	-meta
-vis
-light
	-bounce 16 
	-bouncescale 1.5 
	-filter 
	-samplesize 1 
	-shadeangle 270 
	-super 8

as well as a _lightmapscale of 0.25 in the worldspawn (compile time even for this small map sucked, but those settings were just asking for it :slight_smile: ). It was very difficult and took a lot of trial and error just to get it looking comparable - but this isn’t something you’d include in a real map anyway (insane settings).

It seems q3map2 uses a different implementation of radiosity compared to Q2, Half-Life, or other games. And it’s not the brute force method employed by Blender (certainly not something like Splutterfish’s Brazil or the Messiah GI renderer).

Is there anything to be done to improve radiosity in q3map2, possibly give it that softer, more “bounced” look, where surrounding walls inherit more of their neighbor’s color?

This is probably most suited for ydnar, but how does q3map2’s radiosity differ from other games? Are there several known methods for doing it? What would be the advantages/disadvantages to a new algorithem or method?

The full sources to my maps and shaders are found here if you’re curious -
http://duralisis.tripod.com/RadComparison.zip

Edit: Cleaned up links, posted pics to Tripod page. Text links if you can’t see the pics.

http://duralisis.tripod.com/b3drender.jpg
http://duralisis.tripod.com/hlrender.jpg
http://duralisis.tripod.com/q3render.jpg


(kat) #2

images don’t show for me for some reason and I’m really interested in seeing these as I’m a Blender user (I’ve been wondering about this sort of stuff for a while)


(duralisis) #3

<snip>
Edited original post later on.


(kat) #4

hmmm… I’m not sure about this one myself… I’ve done some comparisons myself but nothing as ‘scientfic’ as this. The tricky thing, I suppose, is blenders game and still image render engines are slightly different to eaach other becasue of the limitations in real time lighting for the game engine, so whereas you may get a good result using the still image renderer it may look quite different running in the game engine… I may be way out of the ball park on this though…


(Tigris) #5

Argh- moved the pics to my space- hope you don’t mind, but that Copy-Paste-Crap of Tripod really pisses me off…


Bender

Half-Life

Q3Map2

This makes me again wonder how things would look a tenebrae maps… anyone care to try that one?

EDIT: Anyway- you can clearly see that both games come off rather dark- so the radiosity should really be turned up even more…

(If you want to replace your links duralisis just do so, then I’ll remove them in this post- that way we could get the topic a bit cleaned up :wink: )


(Hewster) #6

Sorry for draggin this old post up, but I was just going through all the
older posts, updating my q3map2 “facts, hints & tips” document, and
stumbled on this post… I couldn’t believe the poor quality of the Q3
render !!!.. so I’ve done my own :slight_smile: (using RtCW)

I used the supplied map from the previous post, and made a couple of
adjustments:

  1. removed the shader light, and added a point light with the following values:
    “_filterradius” “8”
    “fade” “0.1”
    “light” “33”

  2. I created shaders for all the textures in the map, with a q3map_lightmapsamplesize 8
    This increased the number of lightmaps from 6 to 8:

textures/gamerad/blocks
{
qer_editorimage textures/gamerad/blocks.tga
q3map_lightmapsamplesize 8
{
map $lightmap
rgbGen identity
}
{
map textures/gamerad/blocks.tga
blendFunc filter
rgbGen identity
}
}

  1. I compiled with q3map2.5.12 with the following switches in 101 seconds:
    BSP -meta
    VIS
    LIGHT -bounce 16 -bouncescale 1.4 -fast -samples 3 -gamma 1.3

I also had a go at doing a render in 3DsMAX:

I can’t work out why the colours are so more vivid in the blender render
than in ANY other renders… its almost as if different textures were used,
if you look at the supplied textures, the red and blue textures are very
pale, in-fact they look like the colours in all the other renders :confused:

Ok thats it, just wanted to show that q3map2’s radiosity is IMO pretty
dam good, when you setup the scene properly :smiley:

Hewster


(ydnar) #7

OK, I’m doing some of my own tests.

The textures are not correct colors. The red is more of a dull orange, and the white was a pink color.

As for the test compile settings, they were overkill. Using anything higher than -super 4 is unecessary, and I generally recommend using -samples N instead of -super N for memory/speed advantage with similar quality.

The light shader incidentally wasn’t subdivided at all, which is why the 1st iteration shadows were sharp.

Also, -shadeangle 270 is silly as it just smooths all the normals in the scene, leading to incorrect normal interpolation and, well, crappy results.

I’ll post shots + info when I finish my tests.

y


(ydnar) #8

-light -samples 2 -gamma 2.0 -bounce 16 -patchshadows

Quake 3 run with these additional settings:

+set r_mapOverbrightBits 0 +set r_overbrightBits 0

Because Quake 3 normally scaleslightmaps 2x blowing out lighting data. The -gamma switch in Q3Map2 2.5.12 lets you set proper gamma w/o blowing out the color saturation that scaling does.

Additionally, the light emitting shader was modified to be 2000 brightness (up from 1000) and subdivided into 8x8 quads for proper penumbra approximation. The textures were also rehued to closer approximate the original Cornell images:

Red: 255 0 0
Blue: 119 142 173
White: 255 255 255

y

Edit:

This is the same as the previous shot, but with the addition of -fastbounce. The total time to run the -light phase on my machine (1.8ghz Athlon XP) is 83 seconds.

The Photoshop histogram of the difference between cornell_01.jpg and cornell_02.jpg:


(ratty redemption) #9

good results ydnar, and any idea how they would compare to hl2`s?


(phobos) #10

[Author previously known as duralisis]

Wow, it’s nice to still see this thread active :). Since I first posted it under my previous account, I’ve since moved to a new ISP and am now able to host images and the example map on my own webspace. I started a new SD forum account just to keep the name straight.

Anyhoo, I’ve updated my original comparison with the tips suggested by ydnar and others; creating a much more efficient map and shader. Here are the results:

I’ve made 2 different versions this time. One with false colors to more closely match the original cornell generated images from long ago (they were very saturated) and another like ydnar’s with true colors.

Examples

(thumbs)

(full images)

I greatly cleaned up the map itself and the compile settings. Turning off overbrightbits and the use of a gamma greatly enhances the result.

The example map and it’s supporting files can be downloaded here:

http://webpages.charter.net/phobos/radiosity.zip

Make sure you add +set r_overbrightbits 0 +set r_mapoverbrightbits 0 to your Quake3 shortcut and run the map with ‘devmap radiosity_1’ or ‘radiosity_2’ for the ydnar like version.

Here’s the compile settings for those interested:

-bsp -meta
-vis
-light -bounce 16 -bouncescale 1.5 -samples 4 -gamma 1.8

I’ll keep playing with different settings and tweaking the shader more. I can still improve upon it with penumbra effects (like y’s) and different bounce values.

I like seeing what Hewster did, I’ve always found the radiosity setup in Max 5/6 to be tricky at best. Great results all around!

[Note] I’ll try and move the original images in this thread to my webspace as soon as I can. It’s been a while since I used the old account.