Rendering Paths
Unity支持不同的Rendering Paths(渲染路径)。您应该根据游戏内容和目标平台/硬件来选择。不同的渲染路径有不同的表现特点,这主要影响光照和阴影。查看render pipeline获取技术细节.
您项目所使用的渲染路径是在Graphics SettingsCamera重写.
如果一个显卡不支持选择的渲染路径,Unity将会自动选择一个低一点保真度(lower fidelity)的路径。例如,在一个GPU上,不能操作 Deferred Shading 那么 Forward Rendering 将会被使用。
Deferred Shading
Deferred Shading(延迟渲染)是光照阴影保真度最高的渲染路径,很适合有许多实时光照的情况。它需要一定程度的硬件支持。
Deferred Shading page获取更多细节。
Forward Rendering
Forward
Legacy Deferred
Legacy Deferred (light prepass)
Deferred Lighting page获取更多细节.
Legacy Vertex Lit
Legacy Vertex Lit
NOTEDeferred rendering 不被正投影所支持。如果相机的投影模式被设置为 Orthographic 相交会一直使用Forward rendering。
Rendering Paths Comparison(渲染路径的比较)
| Deferred | Forward | Legacy Deferred | Vertex Lit | |
|---|---|---|---|---|
| Features(特性) | ||||
| Per-pixel lighting (normal maps, light cookies)(逐像素光照) | Yes | Yes | Yes | - |
| Realtime shadows(实时阴影) | Yes | With caveats | Yes | - |
| Reflection Probes(反射探针) | Yes | Yes | - | - |
| Depth&Normals Buffers(深度&法向缓存) | Yes | Additional render passes | Yes | - |
| Soft Particles(软粒子) | Yes | - | Yes | - |
| Semitransparent objects(半透明对象) | - | Yes | - | Yes |
| Anti-Aliasing(抗锯齿) | - | Yes | - | Yes |
| Light Culling Masks(消隐遮罩) | Limited | Yes | Limited | Yes |
| Lighting Fidelity(光照细度) | All per-pixel | Some per-pixel | All 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 | Number of pixels it illuminates | - |
| Number of times objects are normally rendered(对象通常渲染的次数) | 1 | Number of per-pixel lights | 2 | 1 |
| Overhead for simple scenes(简单场景的开销) | High | None | Medium | None |
| Platform Support(平台支持) | ||||
| PC (Windows/Mac) | Shader Model 3.0+ & MRT | ALL | Shader Model 3.0+ | ALL |
| Mobile (iOS/Android) | OpenGL ES 3.0 & MRT, Metal (on devices with A8 or later SoC) | ALL | OpenGL ES 2.0 | ALL |
| Consoles | XB1, PS4 | All | XB1, PS4, 360 | - |