2008 | OriginalPaper | Chapter
Modifying surface geometry
Published in: Writing mental ray® Shaders
Publisher: Springer Vienna
Activate our intelligent search to find suitable subject content or patents.
Select sections of text to find matching patents with Artificial Intelligence. powered by
Select sections of text to find additional relevant content using AI-assisted search. powered by
So far, our shaders have only been calculating color values—the type of the result argument has been a pointer to miColor. Many shaders depend upon the shape of a surface to calculate the way in which light determines the resulting color value. By modifying the surface geometry in a shader, we can affect the calculation of that color. In a
displacement shader
, the result is a miScalar that defines how far along the surface normal the current point should be moved. Displacement shaders can provide geometric detail at a scale that would be very difficult to model directly.