Jump to content

Hedgehog Engine 2 - Deferred Rendering: Difference between revisions

From HedgeDocs
Justin113D (talk | contribs)
Created page with "Deferred rendering is a rendering technique used in Hedgehog Engine 2 games. The “standard” way of rendering is called “forward rendering”, and simply draws one mesh after another, including all the lighting calculations. But since one mesh can hide a significant portion of another, many of those lighting calculations go to waste and could be better spent elsewhere. This is where deferred rendering comes in: Instead of calculating the lighting for every mesh in..."
 
Justin113D (talk | contribs)
Added composited image
 
(One intermediate revision by the same user not shown)
Line 11: Line 11:
|-
|-
|style="text-align:center;"|[[File:SXSG Deferred Rendering Albedo.png|center|The albedo buffer of Kingdom Valley in Shadow Generations]]  
|style="text-align:center;"|[[File:SXSG Deferred Rendering Albedo.png|center|The albedo buffer of Kingdom Valley in Shadow Generations]]  
The albedo buffer
The [[Hedgehog Engine 2 - Physically Based Rendering (PBR)#Albedo|albedo]] buffer
 
|style="text-align:center;"|[[File:SXSG Deferred Rendering PBR.png|center|The specular, inverted smoothness and ambient occlusion buffer of Kingdom Valley in Shadow Generations]]
The [[Hedgehog Engine 2 - Physically Based Rendering (PBR)#Specular|specular]], inverted [[Hedgehog Engine 2 - Physically Based Rendering (PBR)#Smoothness|smoothness]] and [[Hedgehog Engine 2 - Physically Based Rendering (PBR)#Ambient Occlusion|ambient occlusion]] buffer
 
|-
 
|style="text-align:center;"|[[File:SXSG Deferred Rendering Normals.png|center|The normal buffer of Kingdom Valley in Shadow Generations]]
|style="text-align:center;"|[[File:SXSG Deferred Rendering Normals.png|center|The normal buffer of Kingdom Valley in Shadow Generations]]
The specular, inverted smoothness and ambient occlusion buffer
|-
|style="text-align:center;"|[[File:SXSG Deferred Rendering PBR.png|center|The specular, roughness and ambient occlusion buffer of Kingdom Valley in Shadow Generations]]
The normals buffer
The normals buffer
|style="text-align:center;"|[[File:SXSG Deferred Rendering Emission.png|center|The emission buffer of Kingdom Valley in Shadow Generations]]
|style="text-align:center;"|[[File:SXSG Deferred Rendering Emission.png|center|The emission buffer of Kingdom Valley in Shadow Generations]]
The Emission buffer
The [[Hedgehog Engine 2 - Physically Based Rendering (PBR)#Emission|emission]] buffer
|}
|}
These, as well as some niche other buffers, can now be combined with lighting and result in this:
[[File:SXSG Deferred rendering combined.png|center|frame|A composited scene of Kingdom Valley from Shadow Generations]]


== Drawbacks ==
== Drawbacks ==

Latest revision as of 21:06, 12 July 2025

Deferred rendering is a rendering technique used in Hedgehog Engine 2 games.

The “standard” way of rendering is called “forward rendering”, and simply draws one mesh after another, including all the lighting calculations. But since one mesh can hide a significant portion of another, many of those lighting calculations go to waste and could be better spent elsewhere.

This is where deferred rendering comes in: Instead of calculating the lighting for every mesh individually, a meshes rendering properties can be stored in multiple frame buffers, which can then be composited together and achieve a similar result!

An Example

Here are some example frame buffers for a scene that uses deferred rendering, captured in Kingdom Valley from Shadow Generations:

The albedo buffer of Kingdom Valley in Shadow Generations
The albedo buffer of Kingdom Valley in Shadow Generations

The albedo buffer

The specular, inverted smoothness and ambient occlusion buffer of Kingdom Valley in Shadow Generations
The specular, inverted smoothness and ambient occlusion buffer of Kingdom Valley in Shadow Generations

The specular, inverted smoothness and ambient occlusion buffer

The normal buffer of Kingdom Valley in Shadow Generations
The normal buffer of Kingdom Valley in Shadow Generations

The normals buffer

The emission buffer of Kingdom Valley in Shadow Generations
The emission buffer of Kingdom Valley in Shadow Generations

The emission buffer

These, as well as some niche other buffers, can now be combined with lighting and result in this:

A composited scene of Kingdom Valley from Shadow Generations

Drawbacks

While faster than forward rendering, this technique is not perfect and has several drawbacks:

  • Requires more GPU memory to store the frame buffers
  • Does not allow for transparency blending
  • No multi-sample-anti-aliasing (MSAA)

Since transparency is a very important feature, only opaque and punch-through meshes use deferred rendering, while transparent meshes get drawn after the deferred buffers have been combined.

Cookies help us deliver our services. By using our services, you agree to our use of cookies.