Log On
     
 





Tutorial: Phong shading

Q3map2 Specific

Q3map2 allows for phong shading, using either the global -shadeangle X switch in light stage, or by using a shader parm.

This MUST have -shade in the light stage in order to work.

The -filter switch (guasian blur) might cause phong shading not work as expected.

This example DOESN'T need to be distributed with the map, since its just redefining parameters for q3map2's -light stage to calculate lightmaps for an already pre-existing texture.

Example Shader:

textures/base_floor/concrete
{
	qer_editorimage textures/base_floor/concrete.tga
	q3map_shadeangle 89 	// This is for the phong breaking angle. must use -shade
	{
		map $lightmap
		rgbGen identity
	}
	{
		map textures/base_floor/concrete.tga
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}

Here's a shot with a custom shader

So have fun, and test on smaller maps to save some time.