The Cg Programming Language
By John W. Ratclif, October 01, 2002
Cg, short for "C for graphics," is a high-level C-like language for graphics programming. John presents a virtual base called "CgBinding" that provides a framework to dynamically bind any Cg program to your application.
Oct02: The Cg Programming Language
<b>(a)</b>
O.HPOS = mul(objviewproj_matrix, I.position);
<b>(b)</b>
dp4 r0.x, c3, v0
dp4 r0.y, c4, v0
dp4 r0.z, c5, v0
dp4 r0.w, c6, v0
mov oPos, r0
Example 1: (a) Cg code for homogenous clip-space coordinate; (b) assembly-language instructions produced from Example 1(a).