-
Notifications
You must be signed in to change notification settings - Fork 2
Shader1
daao edited this page Aug 5, 2018
·
2 revisions
ShaderLab Syntax
Shader "name" { [Properties] Subshaders [Fallback] [CustomEditor] }
ShaderLab: SubShader
Subshader { [Tags] [CommonState] Passdef [Passdef ...] }
// ...
SubShader {
Tags { "Queue" = "Transparent" } //Note that the following tags recognized by Unity must be inside SubShader section and not inside Pass!
Lighting Off //Any statements that are allowed in a Pass definition can also appear in Subshader block. This will make all passes use this “shared” state.
Pass {
}
}
ShaderLab: SubShader Pass
Pass { [Name and Tags] [RenderSetup] }
// ...
SubShader{
Pass {
Name "TestPass"
Tags { "LightMode" = "ForwardBase" }
}
}
// ...
ShaderLab: other commands => Category
Category {
Tags {
"Queue"="Transparent"
}
Blend SrcAlpha One
SubShader {
Pass {
.......
}
}
}
surface / vetex&fragment / fixed function
unity 对于旧平台的不支持 导致对 fixed function 的维护兴趣大大降低, 并且把现阶段的 fixed fuction 代码在导入阶段就开始转换了 http://aras-p.info/blog/2015/04/27/optimizing-unity-renderer-3-fixed-function-removal/
https://docs.unity3d.com/Manual/UpgradeGuide5-Shaders.html
So Just use vetex&fragment
Note: Deferred rendering is not supported when using Orthographic projection. If the camera’s projection mode is set to Orthographic, these values are overridden, and the camera will always use Forward rendering.