JavaScript EditorFree JavaScript Editor     Ajax Editor 



Main Page
Previous Page
Next Page

5.10. Summary

The OpenGL Shading Language contains a rich set of built-in functions. Some of these functions are similar to those found in C and C++, and others are similar to those found in RenderMan. These functions expose hardware functionality (e.g., texture access) or support common operations (e.g., square root, clamp), or they represent operations likely to be accelerated in future generations of graphics hardware (trigonometry functions, noise, etc.).

Function overloading is used extensively because many of these functions operate on either vectors or scalars. Vendors that support the OpenGL Shading Language are expected to provide optimal implementations of these functions, so the built-in functions should be used whenever possible.

The built-in mathematical functions can be used in some unique and perhaps unexpected ways to create procedural textures. Shader examples throughout the rest of this book illustrate this. Visualizing the function needed to achieve a particular effect can be a vital part of the shader development process.


Previous Page
Next Page



Macho Man effect
JavaScript EditorAjax Editor     JavaScript Editor