|
|
|
|
|
|
|
|
|
|
public static string EmitTransform(TransformDesc[] matrices, TransformDesc[] invMatrices, string variable, bool isAffine, bool inverseTranspose) |
|
|
|
{ |
|
|
|
// Use inverse transpose for situations where
|
|
|
|
// scale needs to be considered (normals)
|
|
|
|
|
|
|
|
if (isAffine) |
|
|
|
{ |
|
|
|
variable = string.Format("float4({0},1.0)", variable); |
|
|
|
|
|
|
{ |
|
|
|
matrix = "(float3x3)" + matrix; |
|
|
|
} |
|
|
|
|
|
|
|
// if the matrix is NOT a transpose type
|
|
|
|
// invert the order of multiplication
|
|
|
|
// it is implicit transpose.
|
|
|
|
if (m.transpose) |
|
|
|
inverseTranspose = !inverseTranspose; |
|
|
|
variable = inverseTranspose |
|
|
|