Example 9: Large SAM

This example shows a large surface attribute mesh with just the backed colour channel stored. The mesh takes a while to prepare as it includes occlusion calculations on displaced surfaces.

Clearly, as only the colour is available, the lighting is completely static and the specular highlights do not move. This looks increasingly incorrect as the camera is moved away from its scene position.

Preparation

There is a prepare.rib that renders the scene in a similar manner to example five.

In the distribution, the shading rate is set to 4 to ensure a reasonably fast initial setup. This results in a fairly rough mesh. A value of 0.4 would be more suitable - the render will take much longer, but the surface will be smoother.

Interacting

The interact.rib is also very simple. The main difference from example five is that the interaction shader interact.sl just passes the colours through.

surface main( varying color Cs = 0;

)

{

Os=1;

//####

Oi = Os;

Ci = Os*Cs;

}

There are no variables that can be adjusted - just the camera position.

Making

As always typing make run in the example directory will process the Makefile to build the mesh and start the application.