Saturate
等价于
Clamp(Value, 0.0, 1.0)
DDX 、DDY
相当于GLSL中的dFdx、dFdy dFdx、dFdy、fwidth
ComputeFilterWidth(材质函数)
与fwidth类似,在UE中可以使用Custom节点使用HLSL调用fwidth dFdx、dFdy、fwidth
// ComputeFilterWidth的实现
// float3 In 输入
// return float3
float3 dDX = ddx(In);
float3 dDY = ddy(In);
float3 A = dot(dDX, dDX);
float3 B = dot(dDY, dDY);
if (A > B)
return sqrt(A);
else
return sqrt(B);