Appearance
【Amplify Shader Editor】
Camera And Screen 摄像机和屏幕
Camera Depth Fade
Clip Planes
相机世界的剪辑平面。
Compute Grab Screen Pos
Compute Screen Pos
Dither 抖动
Grab Screen Color 抓取屏幕颜色
Grab Screen Position 抓取屏幕位置
Ortho Params 正交参数
Projection Matrices
相机的投影、反投影矩阵。
Projection Params
Screen Depth
Screen Params
相机渲染目标尺寸参数。
Screen Position
View Dir
世界空间像素坐标→摄像机坐标的方向。
shader
float3 vDirWS = normalize(_WorldSpaceCameraPos.xyz - i.posWS.xyz);// 世界空间下的摄像机方向 // 或者 float3 vDirWS = normalize(UnityWorldSpaceViewDir(i.posWS));
World Space Camera Pos
世界空间相机位置。
Z-Buffer Params
线性Z缓存值。
Constants And Properties 常量
Color
Float
Global Array
Gradient
Int
Matrix 3X3
Matrix 4X4
PI
Tau (2XPI)
Vector2
Vector3
Vector4
Functions
Image Effects
BlendOperations
图片混合,可指定混合方式。
Desaturate
淡化饱和度。
Gamma To Linear
Liner To Gamma
Grayscale
去色。
RGB to HSV
HSV to RGB
Luminance
获取亮度值。
Posterize
色调分离。
Simple Contrast
简易的对比度设置。
Light 灯光
Blinn-Phong Light
Fog And Ambient Colors
Fog Params
Indirect Diffuse Light
间接漫反射。
Indirect Specular Light
间接高光。
Light Attenuation
Light Color
Object Space Light Dir
对象空间里的光方向。
World Space Light Dir
世界空间里的光方向。
World Space Light Pos
Shader Vertex Lights
Generic 通用
Decode Float RG
Logical Operators
And
Compare
Compare With Range
Debug Switch
IF
Material Quality
OR
Static Switch
Template Multi-Pass Switch
Toggle Switch
Math Operators
Abs
Add
Ceil
Clamp
Compute Filter Width
DDX
DDY
Divide
Exp
Exp2
Floor
Fmod
Fract
FWidth
可以用于解决遮罩的锯齿问题。例如:
shader
// 有锯齿
float borderMask = step(0,-borderSdf);
shader
// 解决锯齿
float pd = fwidth(borderSdf); // Screen Space Partial Derivative 屏幕空间偏导数
float borderMask = 1 - saturate(borderSdf / pd);// Node: saturate 等同于clamp01
fwidth(borderSdf);
等同于 length(float2( ddx(borderSdf), ddy(borderSdf)));
Inverse Lerp
Lerp
Log
Log10
Log2
Max
Min
Multiply
Negate
One Minus
Power
Remainder
Remap
Round
Rsqrt
Saturate
Scale
Scale And Offset
Sign
Simplified Fmod
Smoothstep
Smoothstep(min,max,x)
如果 x > max 则输出 1 。
如果 x < min 则输出 0 。
如果在 min 和 max 之间,则曲线插值。
Sqrt
Step
Step(A,x)
如果 x > A 则输出 1 否则输出 0。