Deferred renderer (shading & lighting)

From Valve Developer Community
< Zh
Revision as of 18:20, 12 June 2025 by BlueMicro (talk | contribs) (Created page with "{{subst:#if: Translation of 'Deferred renderer' to '中文' via Template:LanguageBar buttons * * * * * * * * * * * * * * * * * * * * * * * * * * * *...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

{{subst:#if:|||

Important step for replacing wikilinks after you've created this page

After you click 'Edit' do what the image shows. If you can't see editing toolbar you need to enable it in 'Preferences' -> Editing -> checkbox 'Enable the editing toolbar'

Preload - Language Links Replace.jpg
参见:  {{LAuto}}

--- DON'T JUST BLINDLY DELETE THIS PART. DO REPLACE THE LINKS AND CATEGORIES. THE PICTURE SHOWS HOW TO USE IT ! ---

SEARCH FOR: \[\[(?!#|File(?:[ _]talk)?:|Image(?:[ _]talk)?:|Media:|Template(?:[ _]talk)?:|MediaWiki(?:[ _]talk)?:|Talk:|Category[ _]talk:|Project[ _]talk:|Valve[ _]Developer[ _]Community[ _]talk:|Help[ _]talk:|User(?:[ _]talk)?:|c:|commons:|Dictionary:|Google:|GoogleGroups:|IMDB:|M:|Meta:|Metawikipedia:|MW:|SdkBug:|SourceForge:|Steampowered:|W:|Wiki:|WikiBooks:|Wikipedia:|Wikiquote:|Wiktionary:|WP:)(:?(?:Category|Category|Help|Project|Valve[ _]Developer[ _]Community|Special|)(?:[^\|\]]+))(\|?.*?)\]\]

REPLACE WITH: {{subst:LAuto|$1$2}}

}}
Under construction.png
This page is actively undergoing a major edit.
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.

Info content.png
This page is being translated.
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.(en)
English (en)中文 (zh)Translate (Translate)

Deferred shading is a screen-space shading technique that is performed on a second rendering pass, after the vertex and pixel shaders are rendered.

Deferred lighting (also known as Light Pre-Pass) is an modification of Deferred shading, which uses three passes, instead of two in deferred shading, where only the lighting calculations are deferred. The shading is still done in the initial pass, but the lighting component of the shading is calculated later.

Both deferred rendering techniques allows many lights to be rendered on the scene without a significant performance hit, however deferred lighting is slightly more demanding than deferred shading, but deferred lighting uses less memory than deferred shading, and rendering transparency & MSAA support is easier on deferred lighting.

Nonetheless, it is much different from the default (usually static) radiosity lighting that comes with 起源 起源 (primarily using Forward renderer). It uses many different lighting passes to generate higher quality lighting, with real-time shadows.

起源2 起源2 games generally use forward rendering, like 半衰期:爱莉克斯 半衰期:爱莉克斯, but games like Dota 2 Dota 2 and Deadlock Deadlock use deferred rendering.

Differences from vanilla radiosity

When compiling a map in any of Valve Valve's games, each map is run through VRAD (which can take a long time depending on hardware and optimizations), which takes data from all the light sources and compiles them into a lightmap texture. While this does provide high-quality and variable lighting, it is completely static, save for the limited ability to toggle on some lights in a scene. The difference between radiosity and deferred lighting is that deferred lighting computes all its lights in real-time, with a low performance cost (cheap). The game takes data from the normals of the object, its geometry, its albedo, and its specular lighting to create real-time accurate lighting.

Dynamic lights in forward rendering

Performance can be significantly reduced if there are too many dynamic light entities like env_projectedtexture (also used on player's flashlight since 起源2007) in forward rendering. Other dynamic lights such as light_dynamic also reduce performance if the lightmap has a small luxel scale and/or the light has custom appearance (lightstyles). Additionally, env_projectedtexture is also limited by the 起源 engine itself (by default), meaning that it only works properly with one env_projectedtexture entity without engine modifications.

Deferred lighting (and deferred shading) does not have these issues or limitations and almost an infinite number of dynamic lights can be active with faster performance than with forward rendering. However, there are also other rendering methods such as "Forward+/Tile" or Clustered Forward which can make dynamic lights less demanding on forward renderer (currently 传送门 2:社区特供版 传送门 2:社区特供版 is the only upcoming Source game, along with Operation: Black Mesa Operation: Black Mesa utilizing this technique).

Features

Drawbacks

  • Traditional anti-aliasing methods like MSAA might not work with deferred lighting and deferred shading, like in Apex Legends 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

Deferred phong ref.png

Usage

Source

Few 起源引擎 games utilize this technique, as it's complicated to implement, the games that do use this are:

Deferred shading

Deferred lighting

Source 2

Deferred shading

Tutorials

See also

Entities

External links

参考文献

参考文献
1. Xen Technical Beta and Screenshot by [TC]Ciaиєz ITA:

Known Issues - Haloing Around Props/Object
MSAA is causing outlines around certain objects. MSSA is a performance killer and we hope to have a better solution for anti-aliasing with the Xen release. To remove the haloing/outline, simply turn off MSAA.. Retrieved on May 10, 2024.

2. Several commands related to deferred rendering such as r_deferred_ can be seen in Dota 2. Additionally, enabling MSAA via console commands in the original (Source 1) release of Dota 2 will breaks the renderer. Since April 27, 2012, it is confirmed that Dota 2 uses deferred shading, and use FXAA (referred as Screen-space Anti-aliasing when the Dota 2 page on VDC was edited in 2012)..