Home | Go for the GT5 look using vertex and fragment shaders! |
|
Introduction
This tutorial explains how we tend to shade our cars. Really this is an area that is often in movement. More shading tutorials here.
Certain F1 tires have a characteristic pattern. We use bumpmapping in combination with specular control to shade them. The Cg shader is dyn_standard_bump_v/f.cg. The bumpmap's alpha channel is used for 'reflectiveness'; it takes its specularity/reflectivity from the bumpmap (2nd) texture's alpha channel (NOT the diffuse map). Useful for tires that have both smooth and rough parts, such as F1 tires.
Note the use of tangents for the bumpmapping to work.
The shader used:
vf_bump
{
; For the tires
diffuse=1 1 1
ambient=1 1 1
shininess=30
specular=1 1 1
vertex_shader
{
file=dyn_standard_bump_v.cg
}
fragment_shader
{
file=dyn_standard_bump_f.cg
}
} shader_f1_wheels~vf_bump { motion_blur=0 tangents=1 layer0 { map=f1_wheels.tga } layer1 { map=f1_wheels_bump.tga } }
Below is a screenshot for the end result.
(last updated November 13, 2012 )