Unity3D翻译——Unity's Rendering Pipeline

Unity's Rendering Pipeline         Unity的渲染流水线

原文地址:http://unity3d.com/support/documentation/Components/SL-RenderPipeline.html

如有翻译不当之处,还请帮忙指出!

 

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.

着色器规定了一个物体本身的材料属性,以及它对光的影响。由于光照计算是在着色器的内部完成的,并且光源与阴影的种类也各不相同,因此,写一个“能用”的着色器其实是一个很繁琐的工作。为了使着色器更容易使用,Unity3引入了表面着色器(Surface Shaders),它可以对光照、阴影、光照贴图、前向渲染以及延迟渲染进行自动地管理。

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

本文档介绍了Unity的光照及渲染流水线的特点,以及表面着色器是如何工作的。

 

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.

您所使用的渲染路径决定了光照是如何进行以及着色器所用的通道。着色器中的每个通道通过通道标签(Pass Tags)来传递光照类型。

·         In Deferred LightingPrepassBase and PrepassFinal passes are used.

·         在延迟渲染中,使用PrepassBasePrepassFinal通道。

·         In Forward RenderingForwardBase and ForwardAdd passes are used.

·         在前向渲染中,使用ForwardBase ForwardAdd通道。

·         In Vertex LitVertexVertexLMRGBM and VertexLM passes are used.

·         在顶点光照中,使用VertexVertexLMRGBMVertexLM通道。

 

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通道通过将纹理、光照与发光材质等属性相结合来渲染最终的颜色值。场景中左右正规的光照计算都是在屏幕空间中单独进行的。具体细节可见延迟渲染

 

Forward Rendering path         前向渲染路径

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

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不能内部创建多种着色器组合来处理有光照贴图与无光照贴图的情况。因此,要处理光照贴图和非光照贴图对象,就必须使用多通道方法来达到这种效果。

·         Vertex pass is used for non-lightmapped objects. All lights are rendered at once, using a fixed function OpenGL/Direct3D lighting model (Blinn-Phong)

·         顶点通道用于非光照贴图物体。所有光照计算均使用OpenGL/Direct3D光照模型(Blinn-Phong)来一次渲染完成。

·         VertexLMRGBM pass is used for lightmapped objects, when lightmaps are RGBM encoded (this happens on most desktops and consoles). No realtime lighting is applied; pass is expected to combine textures with a lightmap.

·         VertexLMRGBM通过用于光照贴图的物体,其中光照贴图是RGBM格式编码(这种情况大多发生在台式机和控制台上)。该通道不需要进行实时光照,而是用来将光照贴图与其他纹理进行混合。

·         VertexLMM pass is used for lightmapped objects, when lightmaps are double-LDR encoded (this happens on mobiles and old desktops). No realtime lighting is applied; pass is expected to combine textures with a lightmap.

·         VertexLMM通道用于光照贴图物体,其中光照贴图是double-LDR格式编码的(这种情况主要发生在移动设备和老式的台式机上)。该通道不需要进行实时光照,而是用来将光照贴图与其他纹理进行混合。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值