This is an experiment that I've been trying out with Q3Map2 and shaders as part of the [I]Q3Map2 Shader Manual: Appendix I - Light Emitting Shaders[/I] section. In this appendix section, I wanted to deal with the differences between pre-Q3Map2 light emitting sky shaders and the improvements made in reduced compile time and increased lightmap quality made possible through Q3Map2 introduced shader keywords.

I wanted to test the resulting differences that certain Q3Map2 specific shader keywords had on a map illuminated by a single source of light eminating from the sun shader. The goal was to test several different changes, one at a time, in comparison to a map compiled with a sky shader emulating pre-Q3Map2 lighting. By comparing screenshots, we can determine where quality improves and perhaps where there may be limitations.

To keep things constant, the same map was compiled with very basic LIGHT switches, -fast is the only switch used (probably shouldn't have used -fast at all but got tired of waiting). The screenshots were all taken from the exact same direction and angle for easy comparisons. All other parts of the shader were kept the same except for certain q3map_* keywords being tested. The screenshots were all taken with "/cg_drawgun 0", "/cg_draw2d 0" and "/r_lightmap 1". The _lightmapscale was lowered in the worldspawn to 0.125. The sky textures were taken from ydnar's "shaderlab_terrain" sample map. The shader was modified from the same map.

This is the base shader used for testing. Note the section where I placed the variables being tested:

[code]<PRE><FONT SIZE="2">
textures/shadermanual/sky
{
	skyparms textures/shaderlab_terrain/env/sky 1024 -	

	q3map_lightImage textures/shaderlab_terrain/sky_clouds.tga

	//*** VARIABLES START ***

	...

	//*** VARIABLES END ***

	surfaceparm sky
	surfaceparm noimpact
	surfaceparm nolightmap
	surfaceparm nodlight

	nopicmip
	nomipmaps

	qer_editorimage textures/shaderlab_terrain/sky_clouds.tga
	
	{
		map textures/shaderlab_terrain/sky_clouds.tga
		tcMod scale 3 3
		//tcMod scroll 0.005 -0.0125
		rgbGen identityLighting
	}
	{
		map textures/shaderlab_terrain/sky_arc_masked.tga
		blendFunc GL_ONE_MINUS_SRC_ALPHA GL_SRC_ALPHA
		tcMod transform 0.25 0 0 0.25 0.1075 0.1075
		rgbGen identityLighting
	}
}
</FONT></PRE>[/code]

The first screenshot emulates a pre-Q3Map2 shader using...

q3map_sun 1 1 1 140 -35 25
q3map_lightSubdivide 256
q3map_surfaceLight 200

... This is the kind of results that you would get using default Quake III Arena shaders. Following that, are the screenshots taken as I made various changes, one at a time, to the above options. The changes made are listed in the top left corner of the screenshots and you can see the resulting differences.

[img]http://members.lycos.co.uk/quakeroats/samples/smapi/smapi01.jpg[/img]
[img]http://members.lycos.co.uk/quakeroats/samples/smapi/smapi01.jpg[/img]
[img]http://members.lycos.co.uk/quakeroats/samples/smapi/smapi01.jpg[/img]
[img]http://members.lycos.co.uk/quakeroats/samples/smapi/smapi01.jpg[/img]
[img]http://members.lycos.co.uk/quakeroats/samples/smapi/smapi01.jpg[/img]
[img]http://members.lycos.co.uk/quakeroats/samples/smapi/smapi01.jpg[/img]
[img]http://members.lycos.co.uk/quakeroats/samples/smapi/smapi01.jpg[/img]
[img]http://members.lycos.co.uk/quakeroats/samples/smapi/smapi01.jpg[/img]

One thing that I didn't record was the quantitative differences in LIGHT compile time between different changes in the shader. I had too many different applications running simultaneously for any accurate measurements anyway. Qualitatively however, I did notice a large reduction in compile time by replacing q3map_lightSubDivide (and q3map_surfacelight) with q3map_skylight (approximately from 80 sec. to about 10 sec.). Other keywords like q3map_lightmapFilterRadius obviously increased compile times somewhat.

What I'd like to see are some other compiles and experiments using this same map. I think it would be interesting to see what kind of results different people can come up with. Some additional things to try may include using different compile switches and different shader keywords.

The map file is available here (smapi.zip - Shader Manual Appendix I):
http://members.lycos.co.uk/quakeroats/samples/