You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some ideas I have regarding the future of the deferred rendering pipeline.
Pipeline
By still enabling forward rendering and volume rendering this could be done incrementally. Say we have the three renderers DeferredRenderer, ForwardRenderer, and VolumeRenderer and one bin for each. They should render individually which means that the rendering pipeline needs to be linearized, first render g-buffer for all deferred rendered objects, then perform the shading pass, then render all forward rendered objects making use of the saved depth buffer for depth testing, then render all volumes.
The below pseudo code is very rough and will need some more thought as it is implemented:
submitRenderables(Root scene graph node) // Pushes to deferredRenderables, forwardRenderables, volumeRenderables
gBuffer = renderGbuffer(deferredRenderables)
// This will probably require ping ponging:
frameBuffer = performShading(gBuffer)
frameBuffer = performForwardRendering(frameBuffer, forwardRenderables)
frameBuffer = performVolumeRendering(frameBuffer, volumeRenderables)
frameBuffer = performPostProcess(frameBuffer) // Blurs, screen space reflections, tone mapping and what not
finalRenderFrameBuffer(frameBuffer)
clearLists(deferredRenderables, forwardRenderables, volumeRenderables)
So instead of rendering the scene graph we submit all renderables to their corresponding renderer. Something similar to RenderEngine::submitRenderables(SceneGraphNode* node) which traverses the scene graph and submits its renderables.
Rendering Bins
Submitting a renderable adds it to one of the rendering bins, one for each renderer.
Renderable::submit(RenderEngine& renderEngine) {
// Pushes this renderable to a list of all renderables to be rendered in the deferred bin:
renderEngine.submitDeferredRenderable(this);
}
Perhaps we would want more rendering bins also depending on blend mode. For example one for standard forward rendering and one for additive forward rendering.
This material should be able to cover a vast amount of non-transparent surfaces.
G-Buffer
I would suggest that all vectors are defined in view space unless there is something that prevents this. Also that the g-buffer is the same for all materials and well defined. Perhaps we need something more than this?:
g-buffer:
Position (x, y, z)
Normal (x, y, z)
Albedo (r, g, b)
Material (roughness, metalness, fresnel term)
other:
Depth buffer
Frame buffer(s) for irradiance to ping-pong between for reading / writing.
The best would be if we could use physical quantities such as radiance and irradiance but might perhaps get a bit hard.
Light Sources
Each light source is rendered individually by rendering a mesh around the light source in the shading pass and using additive fragment blending. When the camera is inside of the light source, the back side is rendered (or just render a full screen quad).
Reference
I played around a bit with deferred PBR rendering a wile ago so this repo might be useful: https://github.com/kbladin/ElkEngine
Not super clean but I learned some things when I implemented it so perhaps some of the ideas can be applied to OpenSpace as well
This discussion was converted from issue #388 on May 21, 2022 14:46.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Some ideas I have regarding the future of the deferred rendering pipeline.
Pipeline
By still enabling forward rendering and volume rendering this could be done incrementally. Say we have the three renderers
DeferredRenderer
,ForwardRenderer
, andVolumeRenderer
and one bin for each. They should render individually which means that the rendering pipeline needs to be linearized, first render g-buffer for all deferred rendered objects, then perform the shading pass, then render all forward rendered objects making use of the saved depth buffer for depth testing, then render all volumes.The below pseudo code is very rough and will need some more thought as it is implemented:
So instead of rendering the scene graph we submit all renderables to their corresponding renderer. Something similar to
RenderEngine::submitRenderables(SceneGraphNode* node)
which traverses the scene graph and submits its renderables.Rendering Bins
Submitting a renderable adds it to one of the rendering bins, one for each renderer.
Perhaps we would want more rendering bins also depending on blend mode. For example one for standard forward rendering and one for additive forward rendering.
Materials
We should have a standard uber material used for all deferred renderables and it should probably make use of the PBR standards https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/PhysicallyBased/
This material should be able to cover a vast amount of non-transparent surfaces.
G-Buffer
I would suggest that all vectors are defined in view space unless there is something that prevents this. Also that the g-buffer is the same for all materials and well defined. Perhaps we need something more than this?:
g-buffer:
other:
The best would be if we could use physical quantities such as radiance and irradiance but might perhaps get a bit hard.
Light Sources
Each light source is rendered individually by rendering a mesh around the light source in the shading pass and using additive fragment blending. When the camera is inside of the light source, the back side is rendered (or just render a full screen quad).
Reference
I played around a bit with deferred PBR rendering a wile ago so this repo might be useful:
https://github.com/kbladin/ElkEngine
Not super clean but I learned some things when I implemented it so perhaps some of the ideas can be applied to OpenSpace as well
Beta Was this translation helpful? Give feedback.
All reactions