[程式] Shader Forge设定环境

楼主: riveranb (River)   2017-03-15 10:55:50
最近有整理Unity Shader Forge Setting说明
大部份内容是我自己脑补(误
给大家参考参考
有写错欢迎指正
也有分享在我的 blog
http://riveragamer.blogspot.tw/2017/03/shader-forge.html
1. Shader Settings
- Path: 对应Shader选单的名字路径
- FallBack: 默认取代shader。由Pick按钮选取
- LOD: Level of details设定,当物件占萤幕面积超过设定数字(如200)
允许使用此shader
- Allow using atlased sprites: 允许使用合成大图(packed atlas)
- Draw call batching: 是否允许batching
- Inspector preview mode: Material inspector检视的预览物体类型
- Target renderers: 此shader指定支援的硬件环境对象
= Direct3D 9: 旧windows DirectX环境
= Direct3D 11: 新windows DirectX硬件环境,在windows环境使用
Unity Editor编辑时Direct3D 9与Direct3D 11要选取才会正常显示,
不支援PC game环境时,最终版本shader不需要选取Direct3D 9与
Direct3D 11
= OpenGL Core: 泛指OpenGL 1.x/2.x/3.x/4.x环境。没有支援PC game
环境时最终版本shader不需要选取OpenGL Core
= OpenGL ES 2.0: 移动装置环境,OpenGL ES2版本
= OpenGL ES 3.0: 移动装置环境,OpenGL ES3版本
= iOS Metal: 移动装置环境,新的iOS绘图环境(建议选取支援)
= Direct3D 11 for Windows RT/Phone: Windows Phone(移动装置版本)
支援的Direct3D 11环境
= Xbox One | PlayStation 4 | PlayStation Vita: 各类家用主机情况
= Nintendo 3DS | Nintendo Wii U: 任天堂装置的支援
3. Lighting
- Render Path: Unity光照绘图流程方案(LightMode),Forward(默认,
传统直接进行绘图流程))与Deferred(分离式绘图流程)
= Forward模式下可设定Light Count。Single Directional(默认)
只允许单一方向光;Multi-light允许场中多个光源(注意每多一个光源会
多跑一次ForwardAdd pass)
- LightMode: 已支援的打光方案。Unlit/Custom(未打光);Blinn-Phone ;
Phone ; PBL(Physically Based Lighting)
= (PBL) Specular Mode分为Specular与Metallic两种反光方案实作
- Gloss Mode: Gloss(光泽感)与Roughness(粗糙感)
= Remap gloss from [0-1] to [1-2048]: 更精确地gloss彩度分布计算,
效能代价较高
- Transparency Mode: 透明打光实作方案。Fade(传统渐透明效果);
Reflective(保持有真实反光表现)
- Energy Consering: 数入与输出结果的光能量是否手恒(对PBL很重要)
- Lightmap & light probes: 允许支援Unity5内建的global illumination光照
方案
- Per-pixel light probe sampling: Light probe环景光照侦测计算是否允许
在per-pixel阶段
- Reflection probe support: 是否支援即时反光光照计算
- Receive Ambient Light: 是否能接收基本模糊光源颜色
- Mask directional light specular by shadows
4. Geometry
- Face Culling: 排除正面或背面或双面绘图选项
- Normal Quality: Interpolated(直接使用内插结果,较省效能但较不准);
Normalized(精确计算)
- Vertex Positioning: 顶点位置座标计算模式。World space(一般几何顶点)
;Clip space(萤幕空间顶点,应用在全萤幕后处理时);
Billboard(视为面向镜头的Billboard对象)
- Normal space: 实做normal mapping(bump mapping)时,normal计算
要采用哪种空间。Tangent(几何表面空间);Object(物体空间);
World(世界空间)
- Vertex offset mode: 顶点位移方式。Relative(相对偏移);Absolute(顶点
座标直接被新的输入值取代)
- Tessellation Mode: 三角形tessellate方法。分为Regular与
Edge length based
- Outline Extrude Direction: 边缘几何突出方向选择。有From origin
(由原点向顶点座标分量展开);Vertex normals(延著顶点法向量延伸);
Vertex colors(由顶点颜色决定偏移量)
- Per-pixel screen coordinates: 是否在每个pixel上计算萤幕对应座标
- Show 2D sprite pixel snap option in material: 精确计算2D sprite
对应萤幕座标,实现精准的sprite based game绘图结果
5. Blending
- Blend Mode: 透明混合方式。Opaque(不透明);Alpha Blended(透明,
由alpha决定不透明度);Alpha Blended Premultipied(透明,
自身RGBA不变累加上去);Additive(透明,新旧颜色RGBA相加);
Screen(透明,旧颜色依新颜色比例衰减);Multiplicative(透明;
新颜色与旧颜色相乘做合成)
= 透明混合公式系数: Source(fragment shader产生颜色);
Destination(目标frame buffer已存在颜色)
- Color Mask: shader写入color buffer时的颜色通道mask
- Dithered alpha clip: 使用Opacity Clip功能时,可支援的
dithered alpha clip matrix(2x2;3x3;4x4)
- Offset Factor, Offset Units: Polygon offset偏移设定
- Per-object refraction/scene color(expensive): 每个物件使用此
shader时都重新更新refractive texture内容(截取当前萤幕),
效能代价很高
= Texture name/group: 共用的refractive texture名字
- Receive Fog: 是否支援Fog运算
- Auto Sort: 自动设定rendering sort相关参数
= Order: Shader tag中Queue设定值
= Render Type: Shader tag中RenderType设定值
= Depth Test: Depth buffer的深度值比较规则
= Ignore Projectors: 是否呼略projector运算效果
= Write to Depth buffer: 此shader的深度结果是否要写入depth buffer
- Stencil Buffer: 此shader是否进行stencil buffer操作
= 可设定Reference Value,Comparison比较规则,Masks for
Read Mask和Write Mask
- Pass(stencil buffer pass情空下的动作);
Fail(stencil buffer fail to pass情况下的动作);
Fail Z(depth buffer fail to pass情况下的动作)
6. Experimental
- Force Shader Model 2.0: 强迫此shader支援shader model 2
(#pragma target 2.0)
- Force no custom shadow pass: 关闭自动产生的shadow pass
- Force no fallback: 强迫在shader中不设定fallback shader
作者: laikyo (六元)   2017-03-15 11:40:00
官方范例的溶解真有趣
作者: chargo (冻结的城市)   2017-03-15 12:11:00
推这个吱吱
作者: sakyer (石理克)   2017-03-15 19:29:00
作者: Bencrie   2017-03-15 19:35:00
503 大学长先拜一下 orz
楼主: riveranb (River)   2017-03-15 20:05:00
咦,ntou ? XD

Links booklink

Contact Us: admin [ a t ] ucptt.com