Zh/Deferred renderer: Difference between revisions
No edit summary |
No edit summary |
||
Line 10: | Line 10: | ||
不过,延迟光照要比延迟着色的要求更高,因为它创建了一个多的 pass。但是延迟光照只有光照着色信息会在最后的 pass 得到处理,所以它的内存开销比延迟着色低,并且延迟光照管线对半透明以及 [[Anti-aliasing#MSAA|MSAA]] 的支持也更好。 | 不过,延迟光照要比延迟着色的要求更高,因为它创建了一个多的 pass。但是延迟光照只有光照着色信息会在最后的 pass 得到处理,所以它的内存开销比延迟着色低,并且延迟光照管线对半透明以及 [[Anti-aliasing#MSAA|MSAA]] 的支持也更好。 | ||
尽管如此, | 尽管如此, 这和{{Src|4}}默认的辐射度( [[radiosity]] )光照(静态的)有巨大的不同(它用的是 '''前向渲染''')。延迟渲染使用大量的 lighting pass 生成更高质量的光照,并且伴随实时阴影。 | ||
{{Src2|4}} | {{Src2|4}} 的游戏也通常使用前向渲染管线, 例如 {{hlalyx|4}}, 但如 {{d2|4}} 和 {{deadlock|4}} 则使用了延迟渲染。 | ||
== | ==与原版光照的区别== | ||
当编译 {{Valve|4|addtext='s}} 游戏的地图时, 每张地图必须通过 [[VRAD]] (它花费大量时间,视硬件性能和 [[Lighting_optimization|optimizations]] 参数而定), VRAD 使用所有光源有关的数据并将最终光照结果覆写到 '''光照贴图'''上, 即使 VRAD 能提供高质量且多种形状的光照,然而它是完全静态的,只能提供 stationary 的光照切换,而不能提供实时变化的光照。[[radiosity]]和延迟管线的区别就在于延迟管线实时计算所有光照,并且开销低。游戏使用物体的法线、几何、Albedo 以及高光反射的信息(都来自 G-Buffer)来实时生成高质量光照。 | |||
== | ==前向管线的动态光照== | ||
前向渲染性能在过多动态光源实体(可投射阴影的 {{code|[[env_projectedtexture]]}},本质上是手电筒阴影,从{{src07}}开始就有)。 别的类型的动态光源,例如{{code|light_dynamic}},当光照贴图的分辨率很高或是光源有自己的 [[Lightstyle|custom appearance]] 时,也会降低性能表现。另外, {{code|env_projectedtexture}} 也被{{src|1}} 本身的默认配置所限制,也就是只有 1 个{{code|env_projectedtexture}}实体时才能正常工作,除非对引擎进行大幅改动。 | |||
延迟光照 (以及延迟着色) 就没有以上的问题或限制,它支持很多光照,并且性能远高于前向管道。不过,也有很多别的渲染管线,例如"Forward+/Tile-Based Forward" 或 [[Clustered rendering|Clustered Forward]] ,也可以使多动态光源渲染的性能与传统方法相比大幅降低。(例如 {{p2ce|2}} ,它是目前唯一一个使用 Clustered Forward 管线的起源游戏;并且还有 {{obm|2}} 正在逐步实现这个技术)。 | |||
== | ==特性== | ||
* | *高性能实时阴影和多光源渲染 | ||
* | *支持近乎无限个动态光源 (而 [[Source]] 默认只支持 1 个 {{ent|env_projectedtexture}}) | ||
* | *高保真的圣光( [[godrays]]) | ||
*[[Volumetric lighting]] | *体渲染([[Volumetric lighting]]) | ||
*Light cookies ( | *Light cookies (预先设定的实时阴影图形状) | ||
==Drawbacks== | ==Drawbacks== |
Revision as of 23:10, 13 June 2025

As a courtesy, please do not edit this while this message is displayed.
If this page has not been edited for at least several hours to a few days, please remove this template. This message is intended to help reduce edit conflicts; please remove it between editing sessions to allow others to edit the page.
The person who added this notice will be listed in its edit history should you wish to contact them.

You can help by finishing the translation.
If this page cannot be translated for some reason, or is left untranslated for an extended period of time after this notice is posted, the page should be requested to be deleted.
Also, please make sure the article complies with the alternate languages guide.
延迟着色 是一种在顶点与像素着色器完成操作后进行的屏幕空间的着色技术。顾名思义“延迟”,即将着色计算延迟到 geometry pass 之后的第二个 lighting pass。
延迟光照 (也被称作 Light Prepass) 是延迟着色的一个变体,与传统延迟渲染的 2 个 pass 不同的是,延迟光照的管线有 3 个 pass。延迟光照的管线里只有光照的着色是被延迟的,而整个着色操作本身并未被延迟。
延迟渲染使得高性能大量光源渲染得以可能。
不过,延迟光照要比延迟着色的要求更高,因为它创建了一个多的 pass。但是延迟光照只有光照着色信息会在最后的 pass 得到处理,所以它的内存开销比延迟着色低,并且延迟光照管线对半透明以及 MSAA 的支持也更好。
尽管如此, 这和 起源默认的辐射度( radiosity )光照(静态的)有巨大的不同(它用的是 前向渲染)。延迟渲染使用大量的 lighting pass 生成更高质量的光照,并且伴随实时阴影。
起源2 的游戏也通常使用前向渲染管线, 例如
半衰期:爱莉克斯, 但如
Dota 2 和
Deadlock 则使用了延迟渲染。
与原版光照的区别
当编译 Valve's 游戏的地图时, 每张地图必须通过 VRAD (它花费大量时间,视硬件性能和 optimizations 参数而定), VRAD 使用所有光源有关的数据并将最终光照结果覆写到 光照贴图上, 即使 VRAD 能提供高质量且多种形状的光照,然而它是完全静态的,只能提供 stationary 的光照切换,而不能提供实时变化的光照。radiosity和延迟管线的区别就在于延迟管线实时计算所有光照,并且开销低。游戏使用物体的法线、几何、Albedo 以及高光反射的信息(都来自 G-Buffer)来实时生成高质量光照。
前向管线的动态光照
前向渲染性能在过多动态光源实体(可投射阴影的 env_projectedtexture,本质上是手电筒阴影,从开始就有)。 别的类型的动态光源,例如light_dynamic,当光照贴图的分辨率很高或是光源有自己的 custom appearance 时,也会降低性能表现。另外, env_projectedtexture 也被起源 本身的默认配置所限制,也就是只有 1 个env_projectedtexture实体时才能正常工作,除非对引擎进行大幅改动。
延迟光照 (以及延迟着色) 就没有以上的问题或限制,它支持很多光照,并且性能远高于前向管道。不过,也有很多别的渲染管线,例如"Forward+/Tile-Based Forward" 或 Clustered Forward ,也可以使多动态光源渲染的性能与传统方法相比大幅降低。(例如 传送门 2:社区特供版 ,它是目前唯一一个使用 Clustered Forward 管线的起源游戏;并且还有
Operation: Black Mesa 正在逐步实现这个技术)。
特性
- 高性能实时阴影和多光源渲染
- 支持近乎无限个动态光源 (而 Source 默认只支持 1 个 env_projectedtexture)
- 高保真的圣光( godrays)
- 体渲染(Volumetric lighting)
- Light cookies (预先设定的实时阴影图形状)
Drawbacks
- Traditional anti-aliasing methods like MSAA might not work with deferred lighting and deferred shading, like in
Apex Legends and
黑山 (the latter title replaced it with FXAA because MSAA caused certain models to have a glowing outline),[1] but it depends how it's implemented in the game, as 异形丛生 延迟, and Lambda Wars still support it, though it's recommended that you use post-processing anti-aliasing methods instead as they work best with deferred lighting, and have a smaller performance hit. MSAA is also more demanding with deferred lighting, and even more demanding on deferred shading compared to forward rendering, and MSAA is harder to implement on deferred shading, while it was easier to implement on deferred lighting.
- All lightmaps are disabled and only deferred lighting lights the world. (仅存在于
之中)
- Can be more taxing on older systems.
- DX9 SM3 or later only, older DirectX compatibility versions are not supported.
Media
Usage
Source
Few 起源引擎 games utilize this technique, as it's complicated to implement, the games that do use this are:
Deferred shading
泰坦陨落 引擎分支 (including
Apex Legends)
Deferred lighting
异形丛生 延迟
黑山
Lambda Wars
Portal 2: Desolation
Hammer (Lighting Preview in stock HL2 and
地层起源)
证实:Hammer use Deferred lighting or shading?
Source 2
Deferred shading
Tutorials
See also
- 异形丛生 延迟
- Clustered rendering - similar technique, can be implemented on both forward and deferred renderer.
- Light editor
- Volumetric lighting
Deferred lighting (Wikipedia)
Entities
External links
- Deferred Shading on LearnOpenGL (basics)
参考文献
参考文献 | ||||
---|---|---|---|---|
|