
11.3. GPU textures 493
void main ( void ){
Compute the tran s fo r med normal
tnorm = NormalMatrix∗VertexNormal ;
Set the built in variable with the vertex po s itio n
g l P o s i t i o n = Mode lV ie wP ro ject ionMatrix ∗Ve r te x Pos i ti o n ;
Copy the vertex position
PP= ModelViewMatrix ∗ V ert e xP o sit i on ;
Pass the vertex position in the texture cell and
the texture cell edge vectors to fragment program
te xp os = Sha der Pos it i on ;
vvec = n or mal iz e ( NormalMatrix ∗ Vvector ) ;
wvec = n or mal iz e ( NormalMatrix ∗ Wvector ) ;
uvec = n orm al iz e ( NormalMatrix ∗ Uvector ) ;
Set color oup tu t variable
Color = Ve rte xCo lor ;
}
Listing