|
|
|
|
All use of my digital work is covered by this
Creative Commons Deed.
Please do not use any of my work for commercial purposes, thank you. |
|
|
|
Phong Shading
|
|
|
|
|
|
|
|
|
|
|
|
|
|
During brushwork editing it is often useful to know which shaders have been applied to which
brush surfaces. By creating special editor images, you can keep track of which shaders are
where in the map.
Take the original texture and open it up in a paint package. Add the relevant text in spaced
intervals across the surface of the texture. Save the new image to the same location as either
a TGA or JPG file. Change the filename so that it has the word '_phong' at the end.
ie. textures \ myrockmap \ myrock_phong.tga
Open up the relevant shader file and find the shader command called 'qer_editorimage' and change it
to point to the new editor image. If this command does not exist in the shader then make sure
you are using a Phong shader template as specified above.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Phong Shading has one parameter which can be altered and is located in the shader file.
The 'q3map_shadeangle' command is used to specify on what angle the smooth shading will
start to be applied.
The angle between two brush planes (surfaces) can be rounded down to a value of between
0 and 179. When the brush plane angle is greater than the q3map_shadeangle value, then Phong
Shading is applied to the edges.
This can be demonstrated by the use of two simple geometrical objects a square and octagonal
block. As in the image to the side demonstrates, as the q3map_shadeangle value is increased the shadows
become softer at the edges until the accent of the edge disappears.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
As the q3map_shadeangle increases beyond the brush plane angle of a square brush, the shape starts
to lose its original profile and look like a cylinder, as the image to left illustrates.
Unfortunately as the q3map_shadeangle increases the shadows can become too soft and form into blobs
or round lumps across the surface of a mesh for example. This is where the shadows being
cast onto upon its self are being Phong Shaded and the whole surface starts to look like liquid.
It is always recommended to start with a low value of 45 and work your way up to a limit of
120. Really high q3map_shadeangle values do not produce good results and look too smooth causing
brushwork profiles to be lost.
|
|
|
|
|
|
|
|
|
|