Types in Cg
¡
Syntax similar to C
¡
Basic types
l
int, float, half, fixed, bool
¡
Vector/Matrix types
l
int4, float3, bool2, float4x4
¡
Arrays
l
int a[3], float4x4 matrices[4][4]
Give usage examples on board.
float3 vec = float3(1, 1, 0);
float3 position = mul(modelViewProjMatrix, input.position).xyz;
float4x4 matrix;
matrix.m_33;
Swizzling