Q3/SOF2 Lighting Differences


(phobos) #1

As a result of following a simple cel shading tutorial over at Q3W (http://www.quake3world.com/ubb/Forum6/HTML/025875.html?), I I’ve noticed some interesting lighting differneces between the vanilla Q3 engine and SOF2’s.

Here is the reference pic supplied by the tutorial’s author at:
http://www.zackstrebeck.com/cel_tut/cel_tut.html

And here’s mine compiled using the same BSP option he specified in GTKRadiant, only for Q3 and with r_overbrightbits set to 0.

With overbrightbits set to 1, the entire scene is completely bleached out. With it set to 0, it’s close but not identical to the reference pic.

The same version of Q3map2 was used, and I think the same version of GTKRadiant, the only difference is the game. I used the map file supplied with the tut.

This leaves me perplexed. Obviously not everyone will have r_overbrightbits set to 0, since it is set to 1 in the default config.

Is there a way to disable overbright by specifying it in a shader?

Also, what accounts for the lighting differences at the same compile settings? The light values are the same.


(chavo_one) #2

It looks like your screenshot has no lightmaps in it and his screenshot does. Did you follow this step (clipped from the tutorial):

It has been suggested to me, to compile with the -external tag in the lighting stage. This gives it a more cartoony look, by eliminating the lightmaps, creating a brighter world.


(chavo_one) #3

A thought occurred to me after I made the post above…Maybe the engines deal with light entities differently. So I downloaded the map file myself and took a look. The light entities are set to 1000 each. In RtCW, having 5 lights at 1000 each in a room that size would bleach out all the shadows like that.

If you didn’t get rid of the lightmaps, maybe you just need to reduce the strength of the lights.


(phobos) #4

I’ll try scaling the lighting and see how it turns out. There are a few shadows in that shot (under the steps, behind the ceiling details), so I’m fairly certain there are lightmaps being produced (and I didn’t use -external).

I got to wondering since the lighting differs so much, I wonder if the SOF2 shot is with “r_overbrightbits 1” set, only the total scaling and lighting model is different.

But then where does Q3map2 get the lighting values and know how to create the lightmaps accordingly? Since the compiler is the same, I assume I should be looking for some entity definitinons (basepath right?)


(phobos) #5

Well I guess I’ve pretty much found the problem. I think that SOF2 lights are approximately 4x those of vanilla Q3. I turned down the lights to 250 and came up with this.

r_overbrightbits = 0

r_overbrightbits = 1

Very interesting though, how with overbright enabled (which is default) the entire image gets darker in places, yet “sunspotted” in others. Perhaps this is the lighting cludge Carmack referred to when he said he managed an ugly hack to get a few more bits of lighting precision when designing Q3.

I still hope there’s a way to control this via a shader though, I haven’t seen it yet in the reference manual but maybe somebody else knows?


(ydnar) #6

r_mapoverbrightbits


(Tigris) #7

AFAIK you can use shaders on playermodels- so my question is:
Can you use cel_shading on playermodels or powerups etc?


(phobos) #8

It stands to reason that you could. Here’s the shader code:

textures/cel/ink
{
	qer_editorimage gfx/colors/black.tga
	
	q3map_notjunc
	q3map_nonplanar
	q3map_bounce 0.0
	q3map_shadeangle 120
	q3map_texturesize 1 1
	q3map_invert
	q3map_offset -2.0
	
	surfaceparm nolightmap
	surfaceparm trans
	surfaceparm nonsolid
	surfaceparm nomarks
	
	sort 16
	
	{
		map gfx/colors/black.tga
		rgbGen identity
	}
}

It seems to work like the moving skin in regular Q3, just shifts vertices.