Deferred shading rendering path翻译
Overview 概述
When using deferred shading, there is no limit on the number of lights that can affect a GameObject. All lights are evaluated per-pixel, which means that they all interact correctly with normal maps, etc. Additionally, all lights can have cookies and shadows.
使用延迟着色时,对游戏对象有影响的光源数量没有限制。所有光都被逐像素估算,这意味着他们都正确地与法线贴图等交互。另外所有光都有cookies(不知道怎么准确翻译,是类似剪影的贴图的东西)和阴影。
Deferred shading has the advantage that the processing overhead of lighting is proportional to the number of pixels the light shines on. This is determined by the size of the light volume in the Scene regardless of how many GameObjects it illuminates. Therefore, performance can be improved by keeping lights small. Deferred shading also has highly consistent and predictable behaviour. The effect of each light is computed per-pixel, so there are no lighting computations that break down on large triangles.
延迟着色的优点在于光照开销与光照亮的像素数量成正比。这取决于光的体积在场景中的大小而不是它照亮了多少游戏对象。因此保持小(体积)的光能够提升性能。延迟着色也拥有高度一致和可预测的行为。每个光的效果是逐像素计算的,因此光照计算在大的三角形时不会出现崩溃。
On the downside, deferred shading has no real support for anti-aliasing and can’t handle semi-transparent GameObjects (these are rendered using forward rendering). There is also no support for the Mesh
Renderer’s Receive Shadows flag and culling masks are only supported in a limited way. You can only use up to four culling masks. That is, your culling layer mask must at least contain all layers minus four arbitrary layers, so 28 of
the 32 layers must be set. Otherwise you get graphical artifacts.
从缺点来看,延迟着色没有真正支持抗锯齿,并且无法处理半透明的游戏对象(他们是用前向渲染的)。也不支持网格渲染器的接受阴影标记(启用后可以显示投射在网格上的阴影)并且对culling mask的支持也是受限的。你最多使用4个剔除遮罩(是light的Culling Mask),即32个层最少勾选28个。 在unity上测试,当light.cullingMask不渲染的层超过4个时,就会出现不正确的图。
Requirements 要求
It requires a graphics card with Multiple Render Targets (MRT), Shader Model 3.0 (or later) and support for Depth render textures. Most PC graphics cards made after 2006 support deferred shading, starting with GeForce 8xxx, Radeon X2400, Intel G45.
pc上使用延迟着色需要一张有MRT(一帧里可以同时渲染多个渲染目标)功能和shader model3.0功能并且支持深度渲染纹理的显卡。从GeForce 8xxx, Radeon X2400, Intel G45开始,大部分06年以后的显卡支持延迟着色。
On mobile, deferred shading is supported on all devices running at least OpenGL ES 3.0.
在移动平台上,只有那些有OpenGL3.0的设备支持延迟着色。
Note: Deferred rendering is not supported when using Orthographic projection. If the Camera’s projection mode is set to Orthographic, the Camera falls back to Forward rendering.
注意:使用正交投影时延迟着色是不支持的。如果摄像机的投影模式是正交投影,摄像机会回退到前向渲染。
Performance considerations 性能注意事项
The rendering overhead of realtime lights in deferred shading is
proportional to the number of pixels illuminated by the light and not
dependent on Scene complexity. So small point or spot lights are very
cheap to render and if they are fully or partially occluded by Scene
GameObjects then they are even cheaper.
延迟着色的实时光渲染开销跟光照亮的像素成正比,并不取决于场景复杂度。所以渲染小的点光源或者聚光灯的开销非常小,如果他们被场景里的物体完全或者部分遮挡那么消耗将更小。
Of course, lights with shadows are much more expensive than lights
without shadows. In deferred shading, shadow-casting GameObjects still
need to be rendered once or more for each shadow-casting light.
Furthermore, the lighting shader that applies shadows has a higher
rendering overhead than the one used when shadows are disabled.
带阴影的光开销显然大于不带阴影的光。延迟着色中,依然需要为每个投影光渲染一次或更多次的投影物体。此外,应用阴影的光照着色器比不用的有更高的开销。
Implementation details 实现细节
Objects with Shaders that do not support deferred shading are rendered after deferred shading is complete, using the forward rendering path.
不支持延迟着色的带有着色器的物体将在延迟渲染完成后通过前向渲染路径进行渲染。
The default layout of the render targets (RT0 - RT4) in the geometry
buffer (g-buffer) is listed below. Data types are placed in the various
channels of each render target. The channels used are shown in
parentheses.
在几何缓存中,渲染目标的默认布局如下所列。数据类型被存放在每个渲染目标的各个通道中。所用通道显示在在括号里。
- RT0, ARGB32 format: Diffuse color (RGB), occlusion (A). RT0 ARGB32(每个通道分别是8bit)格式:漫反射颜色 (RGB),遮挡(A)
- RT1, ARGB32 format: Specular color(RGB), roughness (A). RT1, ARGB32 格式:高光颜色(RGB),粗糙度(A)。
- RT2, ARGB2101010 format: World space normal (RGB), unused (A). RT2,ARGB2101010 (alpha通道为两位,其余通道均为10位)格式:世界坐标法线(RGB),未使用(A)。
- RT3, ARGB2101010 (non-HDR) or ARGBHalf (HDR) format: Emission + lighting + lightmaps + reflection probes buffer. RT3,ARGB2101010 (non-HDR非高动态范围) 或者ARGBHalf(每个通道分别是16位的浮点数)(HDR高动态范围):自发光+光照+光照贴图+反射探针缓冲。
- Depth+Stencil buffer. 深度+模板缓冲。
So the default g-buffer layout is 160 bits/pixel (non-HDR) or 192 bits/pixel (HDR).
所以默认的几何缓冲布局是每像素160位 (non-HDR) 或者192位 (HDR) 。
If using the Shadowmask or Distance Shadowmask modes for Mixed lighting, a fifth target is used:
- RT4, ARGB32 format: Light occlusion values (RGBA).
如果为混合光照使用Shadowmask或者Distance Shadowmask模式,第五个对象将会被使用:
RT4,ARGB32格式:光遮挡值(RGBA)
And thus the g-buffer layout is 192 bits/pixel (non-HDR) or 224 bits/pixel (HDR).
因此几何缓冲布局是每像素192位(non-HDR)或者224位(HDR)。
If the hardware does not support five concurrent rendertargets then
objects using shadowmasks will fallback to the forward rendering path.
Emission+lighting buffer (RT3) is logarithmically encoded to provide
greater dynamic range than is usually possible with an ARGB32 texture,
when the Camera is not using HDR.
如果硬件不支持五个并行的渲染目标,那么物体使用阴影蒙版时会回退到前向渲染路径。当相机没有使用HDR时,自发光+光照缓冲(RT3)是对数编码的以提供比通常ARGB32纹理更好的动态范围。
Note that when the Camera is using HDR rendering, there’s no separate
rendertarget being created for Emission+lighting buffer (RT3); instead
the rendertarget that the Camera renders into (that is, the one that is
passed to the image effects) is used as RT3.
注意,当相机使用HDR渲染时,没有为自发光+光照缓冲生成单独的渲染目标;相反摄像机渲染的目标(传递给图像效果的那个)被用作RT3。
G-Buffer pass几何缓冲通道
The g-buffer pass renders each GameObject once. Diffuse and specular
colors, surface smoothness, world space normal, and
emission+ambient+reflections+lightmaps are rendered into g-buffer
textures. The g-buffer textures are setup as global shader properties
for later access by shaders (CameraGBufferTexture0 .. CameraGBufferTexture3 names).
几何缓冲通道渲染每个游戏对象一次。漫反射和镜面高光颜色,表面平滑度,世界空间法向量,和自发光+环境+反射光+光照贴图都被渲染进几何缓冲纹理。几何缓冲纹理被设置成全局着色器属性,为了着色器之后访问(命名为CameraGBufferTexture0 .. CameraGBufferTexture3)。
Lighting pass光照通道
The lighting pass computes lighting based on g-buffer and depth.
Lighting is computed in screen space, so the time it takes to process is
independent of Scene complexity. Lighting is added to the emission
buffer.
光照通道基于几何缓冲和深度计算光照。光照是在屏幕空间被计算的,所以计算的时间与场景复杂度无关。光照被添加到自发光缓冲。
Point and spot lights that do not cross the Camera’s near plane are
rendered as 3D shapes, with the Z buffer’s test against the Scene
enabled. This makes partially or fully occluded point and spot lights
very cheap to render. Directional lights and point/spot lights that
cross the near plane are rendered as fullscreen quads.
没有与摄像机的近裁剪面交叉的点光源和聚光灯被当做3D图形渲染,并且针对场景的深度值测试是启用的。与近裁剪面相交的平行光和点光源/聚光灯被渲染成全屏四边形。
If a light has shadows enabled then they are also rendered and
applied in this pass. Note that shadows do not come for “free”; shadow
casters need to be rendered and a more complex light shader must be
applied.
如果光的阴影是启用的,那么他们将会在这个通道里渲染和应用。注意阴影并不是“免费”的;阴影投射器需要被渲染并且需要应用一个更加复杂的光照着色器。
The only lighting model available is Standard. If a different model
is wanted you can modify the lighting pass shader, by placing the
modified version of the Internal-DeferredShading.shader file from the Built-in shaders into a folder named “Resources” in your “Assets” folder. Then open the Graphics settings (menu: Edit > Project Settings,
then click the Graphics category). Change the “Deferred” dropdown to
“Custom Shader”. Then change the Shader option which appears to the
shader you are using.
唯一可用的光照模型是Standard。如果需要不同模型,你可以通过放置内置延迟着色的修改版本,用于修改光照通道着色器。着色器文件从内置着色器进入到Assets/Resources文件夹下。然后打开Graphics设置(菜单:Edit > Project Settings,然后点击Graphics类别)。修改“Deferred”下拉框为“Custom Shader”。然后将着色器选项改成你所使用的着色器。
Deferred shading rendering path翻译的更多相关文章
- Unity5 的新旧延迟渲染Deferred Lighting Rendering Path
unity5 的render path ,比4的区别就是使用的新的deferred rendering,之前的4的deferred rendering(其实是light prepass)也被保留了下来 ...
- 渲染路径-Unity5 的新旧推迟渲染Deferred Lighting Rendering Path
Unity5 的新旧延迟渲染Deferred Lighting Rendering Path unity5 的render path ,比4的区别就是使用的新的deferred rendering,之 ...
- Unity的Deferred Shading
什么是Deferred Shading Unity自身除了支持前向渲染之外,还支持延迟渲染.Unity的rendering path可以通过Edit/Project Settings中的Graphic ...
- Thinking in Unity3D:渲染管线中的Rendering Path
关于<Thinking in Unity3D> 笔者在研究和使用Unity3D的过程中,获得了一些Unity3D方面的信息,同时也感叹Unity3D设计之精妙.不得不说,笔者最近几年的 ...
- Deferred Shading 延迟着色(翻译)
原文地址:https://en.wikipedia.org/wiki/Deferred_shading 在3D计算机图形学领域,deferred shading 是一种屏幕空间着色技术.它被称为Def ...
- 【原】实时渲染中常用的几种Rendering Path
[原]实时渲染中常用的几种Rendering Path 本文转载请注明出处 —— polobymulberry-博客园 本文为我的图形学大作业的论文部分,介绍了一些Rendering Path,比较简 ...
- Unity Lighting - Choosing a Rendering Path 选择渲染路径(三)
Choosing a Rendering Path 选择渲染路径 Unity supports a number of rendering techniques, or ‘paths’. An i ...
- 渲染路径-实时渲染中常用的几种Rendering Path
http://www.cnblogs.com/polobymulberry/p/5126892.html?utm_source=tuicool&utm_medium=referral 回到顶部 ...
- shader 3 rendering path
渲染通道, rendering path. vertexlit, forward 和 Deferred lighting 旧有的非统一架构下: 分为顶点着色引擎和像素渲染通道 渲染通道是GPU负责给图 ...
随机推荐
- 2019-3-8-win10-uwp-渲染原理-DirectComposition-渲染
title author date CreateTime categories win10 uwp 渲染原理 DirectComposition 渲染 lindexi 2019-03-08 09:18 ...
- 评分模型的检验方法和标准通常有:K-S指标、交换曲线、AR值、Gini数等。例如,K-S指标是用来衡量验证结果是否优于期望值,具体标准为:如果K-S大于40%,模型具有较好的预测功能,发展的模型具有成功的应用价值。K-S值越大,表示评分模型能够将“好客户”、“坏客户”区分开来的程度越大。
评分模型的检验方法和标准通常有:K-S指标.交换曲线.AR值.Gini数等.例如,K-S指标是用来衡量验证结果是否优于期望值,具体标准为:如果K-S大于40%,模型具有较好的预测功能,发展的模型具有成 ...
- Python--day24--多继承
如果本生没有func方法的话就调用距离自己最近的基类的方法 钻石继承: 查找方法的顺序:如下例的找func方法(广度优先) 例1: 例2: 漏斗继承: 小乌龟继承问题:(最顶端的节点F是最后查找的) ...
- C# 强转会不会抛出异常
最近遇到一个小伙伴问我,从一个很大的数强转,会不会抛出异常.实际上不会出现异常 最简单的代码是使用一个比 maxvalue 大的数,然后用它强转 long tathkDucmmsc = int.Max ...
- 初次使用pycharm 的interpreter option为空解决办法。
第一步:进入Setting. 第二步:进入Project中的Project Interpreter.选择添加即可.
- ASP.NET MVC 实现页落网资源分享网站+充值管理+后台管理(16)之轻博客
源码下载地址:http://www.yealuo.com/Sccnn/Detail?KeyValue=c891ffae-7441-4afb-9a75-c5fe000e3d1c 项目到上面一步其实已经算 ...
- 【codeforces 749A】Bachgold Problem
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...
- Vue-route页面切换过渡动画
重点: 1.判断路由前进还是后退 2.切换时动画如何实现 1.需要给各个页面定义层级,切换路由时判断进入哪个层级页面,如果进入层级高页面做前进动画,否则做后退动画在路由定义中添加meta自定义参数 ...
- 洛谷——P1160 队列安排(链表的基础操作)
#include<bits/stdc++.h> using namespace std; ]; list<int> stus; list<];//用来存放每一项的迭代器 ...
- Winform C#关于utf8编码问题
public string SendDataByPost(string param, string Url) { try { HttpWebRequest request = (HttpWebRequ ...