unity3d渲染通道的相关翻译知识

来源:互联网 发布:梦龙网络计划软件win8 编辑:程序博客网 时间:2024/04/27 22:49



Unity's Rendering Pipeline


Shaders define both how an object looks by itself (its material properties) and how it reacts to the light. Because lighting calculations must be built into the shader, and there are many possible light & shadow types, writing quality shaders that "just work" would be an involved task. To make it easier, Unity 3 introduces Surface Shaders, where all the lighting, shadowing, lightmapping, forward vs. deferred lighting things are taken care of automatically.


unity3d教程 着色器定义一个物体的外观如何(其材料特性),以及它对光的反应。由于光照计算,必须建立到着色器中,并有可能用到许多光与阴影类型,编写高质量的着色器,“只是工作”将是一个复杂的任务。为了更方便,Unity3d介绍了Surface Shaders,其中所有的照明,阴影,lightmapping,与延迟照明的东西都被自动处理。


This document describes the pecularities of Unity's lighting & rendering pipeline and what happens behind the scenes of Surface Shaders.


本文档介绍了Unity3d灯光渲染管线的特点和表面着色的场景背后发生了什么。

Rendering Paths
渲染路径


How lighting is applied and which Passes of the shader are used depends on which Rendering Path is used. Each pass in a shader communicates its lighting type via Pass Tags.




照明被如何应用取决于着色器使用了啥样的渲染路径。在着色器中的每一个通道,通过通道标签类型来计算它的光照类型unity3d模型 。

In Deferred Lighting, 
PrepassBase
and 
PrepassFinal
passes are used. 延迟照明,使用PrepassBase和PrepassFinal通道。 
In Forward Rendering, 
ForwardBase
and 
ForwardAdd
passes are used. 正向渲染,使用ForwardBase和ForwardAdd通道。 
In Vertex Lit, 
Vertex

VertexLMRGBM
and 
VertexLM
passes are used.    顶点光照,使用Vertex,VertexLMRGBM VertexLM通道。 
In any of the above, to render Shadows, 
ShadowCaster
and 
ShadowCollector
passes are used. 在上述任何一种,都用了渲染阴影, 使用ShadowCaster 和ShadowCollector通道。


Deferred Lighting path
延迟照明路径


PrepassBase
pass renders normals & specular exponent; 
PrepassFinal
pass renders final color by combining textures, lighting & emissive material properties. All regular in-scene lighting is done separately in screen-space. See Deferred Lighting for details.


PrepassBase通道渲染法线和镜面反射指数; PrepassFinal通道通过纹理,照明及发光材料的性能相结合的方式渲染最终的颜色。unity3d中文手册所有现场照明都是在屏幕空间中立完成的。延迟照明的 详细信息请查看:Deferred Lighting 。


Forward Rendering path
正向渲染路径




ForwardBase
pass renders ambient, lightmaps, main directional light and not important (vertex/SH) lights at once. 
ForwardAdd
pass is used for any additive per-pixel lights; one invocation per object illuminated by such light is done. See Forward Rendering for details.


ForwardBase通道渲染环境,光线贴图,主要的方向光,和不重要的 (vertex/SH) 光线被一次处理。ForwardAdd 通道被用于处理附加的逐像素光照;。一次调用使逐个物体发光。查阅正向光照细节: Forward Rendering 。




If forward rendering is used, but a shader does not have forward-suitable passes (i.e. neither 
ForwardBase
nor 
ForwardAdd
pass types are present), then that object is rendered just like it would in Vertex Lit path, see below.
如果正向渲染被使用,但着色器没有forward-suitable通道(既不存在ForwardBase的也不存在ForwardAdd通道类型),那么该对象被渲染成类似它在顶点光照路径中的那样,请参阅下文。


Vertex Lit Rendering path
顶点光照的渲染路径


Since vertex lighting is most often used on platforms that do not support programmable shaders, Unity can't create multiple shader permutations internally to handle lightmapped vs. non-lightmapped cases. So to handle lightmapped and non-lightmapped objects, multiple passes have to be written explicitly.


由于顶点光照是最常用在那些不支持可编程着色器的平台上,Unity不能创建多个着色器的排列在内部处理lightmapped与非lightmapped的情况。因此,处理多lightmapped 和non-lightmapped objects的多通道必须被显式写入。
0 0