Types in Cg
¡Syntax similar to C
¡Basic types
lint, float, half, fixed, bool
¡Vector/Matrix types
lint4, float3, bool2, float4x4
¡Arrays
lint 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