Deferred shading

from Wikipedia, the free encyclopedia

In the computer graphics describes Deferred Shading (Engl. Delayed or deferred shading ) a method in three-dimensional scenes, the geometry processing , ie to separate the representation of the physical form of the objects from the light calculation. Several hundred dynamic lights are possible in geometrically complex scenes. The basic idea of ​​only calculating a final pixel color value after the depth resolution was first proposed by Michael Deering et al. Introduced in 1988. The concept known today comes from Saito and Takahashi from 1990.

principle

The various render targets as well as information on the light sources are calculated to produce the finished image.

In conventional rendering methods is based on depth ( depth , orientation () normals ) and color ( albedo ) of a corner point, intensity, and angle of incidence of a light source of the final color value for each vertex determined. Each light source must be used for the calculation for each corner point.

With deferred shading , the depth value, alignment and color of each pixel are now saved in a texture the size of a screen. This is made possible by so-called Multiple Render Targets , whereby in each rendering process different frame buffer objects (the textures) can be written at the same time. Instead of calculating every corner point with the light sources, only every pixel (in which all required values ​​- depth, normals and albedo - are available) have to be taken into account in the calculation.

The calculation itself is carried out using classic lighting models, for example according to Phong . Highlight can also be included. Technically, this happens in the pixel or fragment shader at the end of the graphics pipeline .

Advantages and disadvantages

If every light source has to be compared with every corner point, this results in an effort of (let m be the number of primitives, n the number of lights), but the lighting takes place after the geometry calculation, the effort is drastically reduced . This enables many hundreds of lights in complex scenes with moderate hardware requirements.

Due to the use of the Multiple Render Targets, however, you are limited to graphics hardware that supports at least Shader Model 3.0 ( OpenGL from version 2, DirectX from version 9). In addition, the use of transparency in the scene turns out to be difficult, since a transparent material contains both its own information and the information of the objects behind it and thus deceives the lighting model. This must be considered and avoided when programming.

application

The first application implemented on graphics hardware experienced deferred shading around 2004. Nowadays (2011) it is standard in most commercial real-time graphics applications and especially known from games such as STALKER , StarCraft II and Gears of War .

Individual evidence

  1. ^ The triangle processor and normal vector shader: a VLSI system for high performance graphics
  2. Comprehensible Rendering of 3-D Shapes
  3. a b Deferred Shading in STALKER ( Memento of the original from July 16, 2011 in the Internet Archive ) Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice.  @1@ 2Template: Webachiv / IABot / http.developer.nvidia.com
  4. Shawn Hargreaves on Deferred Shading (PDF; 449 kB)
  5. ^ Starcraft 2: Technology and engine dissected
  6. ^ Unreal Developer Network