Unity3D Shader

来源:互联网 发布:vb滚动条颜色怎么设置 编辑:程序博客网 时间:2024/03/29 19:29

1.RenderType

Opaque: 用于大多数着色器(法线着色器、自发光着色器、反射着色器以及地形的着色器)。
Transparent:用于半透明着色器(透明着色器、粒子着色器、字体着色器、地形额外通道的着色器)。
TransparentCutout: 蒙皮透明着色器(Transparent Cutout,两个通道的植被着色器)。
Background: Skybox shaders. 天空盒着色器。
Overlay: GUITexture, Halo, Flare shaders. 光晕着色器、闪光着色器。
TreeOpaque: terrain engine tree bark. 地形引擎中的树皮。
TreeTransparentCutout: terrain engine tree leaves. 地形引擎中的树叶。
TreeBillboard: terrain engine billboarded trees. 地形引擎中的广告牌树。
Grass: terrain engine grass. 地形引擎中的草。
GrassBillboard: terrain engine billboarded grass. 地形引擎何中的广告牌草。

2.Rendering Paths

Unity supports different Rendering Paths. You should choose which one you use depending on your game content and target platform / hardware. Different rendering paths have different features and performance characteristics that mostly affect Lights and Shadows.

Unity支持不同的渲染路径。您应具体取决于你的游戏内容和目标平台/硬件来选择使用哪一个。不同的渲染路径有不同的特点和性能特点,主要影响灯光和阴影。

The rendering Path used by your project is chosen in Player Settings. Additionally, you can override it for each Camera.

您的项目所使用的渲染路径在Player Settings选择。此外,您可以为每个摄像机重写(不同摄像机可以是不同的设置)。

If the graphics card can't handle a selected rendering path, Unity will automatically use a lower fidelity one. So on a GPU that can't handle Deferred Lighting, Forward Rendering will be used. If Forward Rendering is not supported, Vertex Lit will be used.

如果图形卡不能处理选定的渲染路径,Unity将自动使用一个较低保真度的设置。因此,在GPU上不能处理延迟照明(Deferred Lighting),将使用正向渲染(Forward Rendering )。如果不支持正向渲染(Forward Rendering ),将使用顶点光照(Vertex Lit)。

Deferred Lighting 延时光照

Deferred Lighting is the rendering path with the most lighting and shadow fidelity. It is best used if you have many realtime lights. It requires a certain level of hardware support, is for Unity Pro only and is not supported on Mobile Devices.

延时光照是有着最高保真度的光照和阴影的渲染路径。如果你有很多实时灯光,最好是使用延时光照。它需要一定水平的硬件支持,仅在 Unity Pro可用,移动设备上不支持。

For more details see the Deferred Lighting page.

更多细节见延时光照页面

Forward Rendering 正向渲染

Forward is a shader-based rendering path. It supports per-pixel lighting (including normal maps & light Cookies) and realtime shadows from one directional light. In the default settings, a small number of the brightest lights are rendered in per-pixel lighting mode. The rest of the lights are calculated at object vertices.

正向渲染一个基于着色器的渲染路径。它支持逐像素计算光照(包括法线贴图和灯光Cookies)和来自一个平行光的实时阴影。在默认设置中,少数最亮的灯光在逐像素计算光照模式下渲染。其余的灯光计算对象顶点的光照。

For more details see the Forward Rendering page.

更多细节见正向渲染页面

Vertex Lit 顶点光照

Vertex Lit is the rendering path with the lowest lighting fidelity and no support for realtime shadows. It is best used on old machines or limited mobile platforms.

顶点光照(Vertex Lit) 是最低保真度的光照、不支持实时阴影的渲染路径。最好是用于旧机器或受限制的移动平台上。

For more details see the Vertex Lit page.

更多细节见顶点光照页面

Rendering Paths Comparison 渲染路径比较

 

Deferred Lighting 延时光照

Forward Rendering 正向渲染

Vertex Lit 顶点光照

Features 功能

 

 

 

Per-pixel lighting (normal maps, light cookies)
每像素计算光照(法线贴图、灯光cookies)

Yes

Yes

-

Realtime shadows 实时阴影

Yes

1 Directional Light(一盏平行光)

-

Dual Lightmaps 双光照贴图

Yes

-

-

Depth&Normals Buffers 深度与法线缓冲区

Yes

Additional render passes 额外渲染通道

-

Soft Particles 软粒子

Yes

-

-

Semitransparent objects 半透明的物体

-

Yes

Yes

Anti-Aliasing 抗锯齿

-

Yes

Yes

Light Culling Masks 灯光剔除蒙板

Limited

Yes

Yes

Lighting Fidelity 光照保真度

All per-pixel 全部像素

Some per-pixel 某些像素

All per-vertex 所有顶点

Performance 性能

 

 

 

Cost of a per-pixel Light 每像素光照的花费

Number of pixels it illuminates
照亮的像素数

Number of pixels * Number of objects it illuminates
像素数*照亮的像素数

-

Platform Support 支持平台

 

 

 

PC (Windows/Mac) 台式机

Shader Model 3.0+

Shader Model 2.0+

Anything

Mobile (iOS/Android) 移动设备

-

OpenGL ES 2.0

OpenGL ES 2.0 & 1.1

Consoles  (游戏)平台

360, PS3

360, PS3

-


0 0