Graphics Reference
In-Depth Information
// Perform a simple shading calc
float3 toCamera = nonmalize( cameraPosition.xyz );
output.Colour = saturate( dot(vWorldNorm, toCamera) ) * float3( 0.4, 0.4, 1.0 );
return output;
}
Listing 9.21. Domain shader for curved point normal triangles.
Despite the importance of the domain shader stage, the code and mathematics in-
volved are relatively simple and straightforward.
Example Output
When the previously described shader programs are plugged in with traditional triangle
geometry, results such as those shown in Figure 9.41 can be generated. Considering that the
Figure 9.41 . Example output with Curved Point Normal Triangles algorithm applied.
Figure 9.42. Original geometry without Curved Point Normal Triangles algorithm applied.
Search WWH ::




Custom Search