标签:skipped 空间 producing app 不能 after fill iss without
本章节描述了延时光照的渲染路径的细节,如果想了解延迟光照技术,请查阅Deferred Lighting Approaches article.
Deferred Lighting is rendering path with the most lighting and shadow fidelity:
延迟光照是一种当前最高级的能实现光线和阴影保真的渲染路径
Deferred Lighting‘s advantages 延迟光照的优点:
Disadvantages 缺点:
Cost of realtime lights in Deferred Lighting is proportional to number of pixels the light shines on; and not dependent on scene complexity. So small point or spot lights are very cheap to render. Point or spot lights that are fully or partially occluded by some scene objects get their pixels skipped on the GPU, so they are even cheaper.
延迟光照中实时光线的开销和光线照亮的像素值的数量成正比。而不取决于场景的复杂性。微小的点光源和聚光灯光源非常容易渲染。点光源或者完全或者部分被场景物体遮挡的聚光灯光源所照射的像素则被GPU所跳过,因此更加廉价。
Of course, lights with shadows are much more expensive than lights without shadows. In Deferred Lighting, shadow casters still need to be rendered once or more for each shadow-casting light. And the lighting shader that applies shadows is also more expensive than one without shadows.
当然,拥有阴影的光源比没有阴影的光源要昂贵许多。使用延迟光照,光影投射器仍然需要为每个阴影投射渲染一次或者多次。而且产生阴影的光线着色器也比不产生阴影的光线着色器要昂贵许多。
When Deferred Lighting is used, rendering process in Unity happens like this:
当延迟光照生效时,在Unity中发生的渲染过程如下:
Objects with shaders that can‘t handle Deferred Lighting are rendered after this process is done, using RenderTech-ForwardRendering path.
不能采用延迟光照技术的带阴影的物体在延迟光照渲染完后使用前向渲染路径处理。
Base pass renders each object once. View space normals and specular power are rendered into single ARGB32 Render Texture (normals in RGB channels, specular power in A). If platform & hardware supports reading Z buffer as a texture, then depth is not explicitly rendered. If Z buffer can‘t be accessed as a texture, then depth is rendered in additional rendering pass, using shader replacement.
基本渲染将每个物体都渲染一次。视图空间法线和高光强度被渲染进单一的ARGB32渲染纹理(法线在RGB通道,高光强度在A通道)中。如果平台和硬件支持将Z缓冲按纹理读取,那么深度不会被明确的渲染。如果Z缓冲不能被以纹理的方式访问,那么深度将在额外的渲染处理中被使用着色器替代技术渲染。
Result of the base pass is Z buffer filled with scene contents and Render Texture with normals & specular power.
基本渲染的结果是被屏幕内容填满的Z缓冲和带有法线和高光强度的渲染纹理。
Lighting pass computes lighting based on depth, normals and specular power. Lighting is computed in screen space, so it‘s independent of scene complexity. Lighting buffer is single ARGB32 Render Texture, with diffuse lighting in RGB channels and monochrome specular lighting in A channel. Lighting values are encoded using logarithmic encoding to provide extended dynamic range than usually possible with ARGB32 texture.
光照渲染基于深度,法线和高光强度计算光照。光照是被屏幕空间被计算的,因此和屏幕复杂性无关。光照缓冲是一个单一的ARGGB32渲染纹理,纹理的RGB通道带有漫反射的光照信息,在A通道带有单一特定颜色的光照。光照值采用对数值编码以产生比通常ARGB32纹理所能达到的动态扩展范围。
Lighting model is fixed to Blinn-Phong.
光照模式固定为Blinn-Phong。
Point and Spot lights that do not cross camera‘s near plane are rendered as 3D shapes, with Z buffer test against 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.
不能跨越临近平面的点光源和聚光灯光源被作为带有开启测试场景的Z缓冲3D形状渲染,这部分和完全屏蔽的点光源和聚光灯光源可以非常廉价的渲染。 跨越临近区域的平行光或者点光源能作为全屏四边形。
If a light has shadows enabled, they are rendered and applies in this pass as well. Note that shadows are not "free"; shadow casters need to be rendered and a more complex light shader needs to be applied.
如果一个带有阴影的光源生效,在这个处理过程中会被很好的渲染。注意阴影并不免费,阴影投射器需要开销来渲染,同时一个更加复杂的光线着色器需要应用。
Final pass produces final rendered image. Here all objects are rendered again; with shaders that fetch the lighting, combine it with textures and add any emissive lighting.
Lightmaps are also applied in the final pass. Close to the camera, realtime lighting is used, and only baked indirect lighting is added. This crossfades into fully baked lighting further away from the camera.
最终渲染阶段产生最后渲染后的图像,到这一步,所有的对象都将被再次渲染,其中着色器将混合前一步生成的光源和纹理以及所有自发光照明。
在最后渲染阶段光照贴图也被应用。靠近相机,使用实时光照,并仅烘焙间接光照。
标签:skipped 空间 producing app 不能 after fill iss without
原文地址:http://www.cnblogs.com/jiahuafu/p/6668096.html