Flips the surface-normal (if needed) to face in a direction opposite to i; returns the result in n.
|ret faceforward(n, i, ng)|
This function uses the following formula: -n× sign(dot(i, ng)).
[in] The resulting floating-point surface-normal vector.
[in] A floating-point, incident vector that points from the view position to the shading position.
[in] A floating-point surface-normal vector.
A floating-point, surface normal vector that is facing the view direction.
|Name||Template Type||Component Type||Size|
|i||vector||float||same dimension(s) as input n|
|ng||vector||float||same dimensions as input n|
|ret||vector||float||same dimensions as input n|
This function is supported in the following shader models.
|Shader Model 2 (DirectX HLSL) and higher shader models||yes|
|Shader Model 1 (DirectX HLSL)||vs_1_1 and ps_1_4|