UNITY SHADER入门精要_学习笔记1

时间:2021-07-24 10:20:44
1.注意OpenGL和DirectX的坐标轴:
UNITY SHADER入门精要_学习笔记1
UNITY SHADER入门精要_学习笔记1
UNITY SHADER入门精要_学习笔记1
UNITY SHADER入门精要_学习笔记1
2.部分专业名词介绍

#pragma surface surfaceFunction lightModel[optionalparams]
声称着色器 表面着色器 着色器代码名称 光照模型
It uses #pragma surface ... directive to indicate it’s a surface shader.
eg:#pragma surface surf Standard fullforwardshadows

介绍lightModel
1.Standard:
This lighting model uses SurfaceOutputStandard output struct,
and matches the Standard (metallic workflow) shader in Unity.

2.Standard:
This Specular lighting model uses SurfaceOutputStandardSpecular output struct,
and matches the Standard (specular setup) shader in Unity.

3.Lambert and BlinnPhong:郎伯模型
This lighting models are not physically based (coming from Unity 4.x),
but the shaders using them can be faster to render on low-end hardware.

3.Unity shader类型
1)Standard Surface Shader:标准光照模型
2)Standard Surface Shader(instanced)
3)Unlit Shader:不包含光照,包含雾效
4)Image Effect Shader:实现屏幕后处理效果
5)Compute Shader:产生一个特殊的shader文件,目的是利用cpu的并行性进行一些与常规渲染流水线无关·

4.Unity Shader语法
UNITY SHADER入门精要_学习笔记1
UNITY SHADER入门精要_学习笔记1