Saturate

等价于Clamp(Value, 0.0, 1.0)

DDX 、DDY

相当于GLSL中的dFdx、dFdy dFdx、dFdy、fwidth

ComputeFilterWidth(材质函数)

与fwidth类似,在UE中可以使用Custom节点使用HLSL调用fwidth dFdx、dFdy、fwidth

HLSL
// 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);
点击展开查看更多

版权声明

作者: Chaim

链接: https://chaim.eu.org/posts/%E6%95%B0%E5%AD%A6-maths/

许可证: CC BY-NC-SA 4.0

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Please attribute the source, use non-commercially, and maintain the same license.

开始搜索

输入关键词搜索文章内容

↑↓
ESC
⌘K 快捷键