Skip to main content

Crate wde_pbr

Crate wde_pbr 

Source
Expand description

Physically based rendering (PBR) integration for WaterDropEngine.

This crate wires the PBR rendering stack into the engine and exposes the core building blocks to configure deferred PBR rendering.

The PBR rendering stack is built on top of the deferred rendering pipeline, and consists of the following passes:

  • [RenderPassEnvironment] (feature atmosphere): Bakes the ambient lighting of the EnvironmentData from the sky when the sun moves: spherical harmonics for the diffuse light, and a prefiltered cube map for the reflections.
  • RenderPassDeferredGBuffer: Renders the scene geometry into the G-buffer (only opaque objects). It writes to the DepthTexture and the G-buffer DeferredTextures (depth, albedo, normal, AO, emissive). Nothing is multisampled: averaging G-buffer samples would mix objects with the background at their edges.
  • RenderPassAmbientOcclusion: GTAO at half resolution from the G-buffer depth, then a depth-aware blur, configured by the AmbientOcclusionSettings resource (disabled by default).
  • RenderPassDeferredLighting: Performs the lighting pass, reading from the G-buffer textures, the ambient occlusion (applied to the ambient light only), the cascaded shadow maps and the environment lighting, and writing to the HDR RenderTexture.
  • RenderPassTransparent: Renders transparent objects, using the DepthTexture for depth testing, and writing to the same RenderTexture as the lighting pass.
  • The post_process passes: fog (before the transparent objects), then the temporal anti-aliasing (TAA), the bloom, the composite (color grading, tonemapping, …), and the anti-aliasing (FXAA or SMAA) to the swapchain. They are configured by the PostProcessSettings resource.

To find out more about the deferred rendering pipeline and how to add custom render subpasses, see the documentation of the deferred module.

Modules§

deferred
Deferred PBR module.
post_process
Post-processing of the HDR RenderTexture, configured by the PostProcessSettings resource.

Structs§

PbrPlugin