shader: "surface evaluation"

"surface evaluation"

ShaderColour

"surface evaluation"( "base colour" LtColour (1.0, 1.0, 1.0)
"band colour" LtColour (1.0, 0.5, 0.5)
"centre" LtPoint (0.0, 0.0, 0.0)
"axis" LtEnum LI_X
"radius" LtFloat 100.0
"bands" LtInt32 50
"coverage" LtFloat 0.2
"fuzz" LtFloat 0.2
"min angle" LtFloat 0.1
"scale" LtFloat 1.0
)
Synopsis Colour shader which simulates reflection of a cylinder with longitudinal bands surrounding the surface being considered. Gives good visual clues to the surface's curvature.
Locationlishpro
Description A traditional method of assessing the curvature of complex surfaces such as car bodies has been to place them within a brightly lit cylinder (or half-cylinder) which has longitudinal stripes (or bands).

This shader provides the ability to perform this test in software easily. The colour shader is simply attached to the geometry in question (using sensible values for the centre, axis and radius) before rendering, and reflections of the imaginary cylinder will be visible on the surface.

The basic colour of the cylinder, and the colour of the bands, are specified by parameters "base colour" and "band colour" respectively. The size and positioning of the cylinder are controlled by the parameters "centre", "axis" (which should be either LI_X, LI_Y, or LI_Z), and "radius".

The total number of bands around the cylinder is given by the parameter "bands". The parameter "coverage" determines the ratio of area covered by the bands to the area not covered---a value of zero means only the base colour is visible, a value of one means only the band colour is visible. The sharpness of the bands is controlled by "fuzz". A value of zero gives very sharply defined edges to the bands, a value of one gives very fuzzy edges.

Parameter "min angle" specifies the minimal value of the normal component along the cylinder axis in order for banding to be applied. In other words it controls how long the virtual cylinder is---smaller values result in a longer cylinder.

\begin{SevenOneFeature} Finally, the overall scale of the pattern produced is controlled by the parameter "scale", allowing you to accurately account for changes to the scale at which you model your geometry. \end{SevenOneFeature}

Notes:

  1. The rays are "reflected" in such a way that the component of reflected ray parallel to the cylinder axis is ignored. It means that all "reflected rays" are perpendicular to the cylinder surface.

  2. If part of the surface is placed outside the cylinder then it is not banded and shows the constant base colour. You should ensure your cylinder is big enough and place its centre in the middle of the geometry being examined.

  3. This shader's full shader function has been written to take advantage of information available from the renderer, such as the current pixel polygon, to perform {analytic anti-aliasing}. This means that anti-aliasing is performed algorithmically, rather than by sampling. The control variable LI_CONTROL_PIXEL_POLY_ON enables this functionality to be disabled (if set to FALSE, so that sampling will be performed even with the full rendering method.

Previous page alphabetically (sun)
Next page alphabetically (tonecontrastscalepp)
Index


Copyright © 1990-2004, 2005 LightWork Design Limited. All rights reserved