您的位置:首页 > 移动开发 > Unity3D

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

2017-04-07 10:35 281 查看
1.注意OpenGL和DirectX的坐标轴:

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语法

5.自定义材质编辑界面:https://docs.unity3d.com/Manual/SL-CustomShaderGUI.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  shader