Chapter 3. Parameters, Textures, and Expressions
This chapter continues to present Cg concepts through a series of simple vertex and fragment programs. The chapter has the following three sections:
“Parameters” explains how Cg programs handle parameters.
“Texture Samplers” explains how fragment programs access textures.
“Math Expressions” shows how math expressions compute new vertex and fragment values.
Parameters
The C2E1v_green
and C2E2f_passthrough
examples from Chapter 2 are very basic. We will now broaden these examples to introduce additional parameters.
Get The Cg Tutorial: The Definitive Guide to Programmable Real-Time Graphics now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.