feat(renderer): render the scene into HDR and tonemap in post #938

Merged
SakulFlee merged 1 commit from feat/renderer-hdr-post into main 2026-10-26 02:58:15 +00:00
Collaborator

Summary

Stacked on #937 (phase 2a). Renders the 3D scene into an HDR target and tonemaps once in a fullscreen post pass.

  • Add a pooled Rgba16Float scene color target.
  • Add a fullscreen ACES tonemap + gamma pass into the surface.
  • Built-in PBR and world-environment shaders now output linear HDR; ACES moved to post.
  • 3D material and sky pipelines now target SCENE_COLOR_FORMAT (Rgba16Float); 2D/UI/text/overlay renderers still target the surface and therefore stay after tonemapping.
  • The sky pass always clears the scene color target, even when no environment is configured, so a reused HDR texture cannot leak the previous frame.
  • Add tonemap.wgsl to the naga-based WGSL validation tests.

This is the prerequisite for FXAA/SMAA, bloom, volumetrics and SSR.

Verification

  • cargo fmt --all -- --check
  • cargo clippy -p orbital_renderer -p orbital_app -p orbital_model -p orbital_world_environment -p orbital_shader_pbr -- -D warnings
  • cargo test -p orbital_renderer -p orbital_app -p orbital_model -p orbital_resources --no-fail-fast
  • cargo check -p template_minimal -p template_all_in_one -p template_2d
  • GUI examples were not launched in this environment (no display/GPU).

Refs #647, #781.

## Summary Stacked on #937 (phase 2a). Renders the 3D scene into an HDR target and tonemaps once in a fullscreen post pass. - Add a pooled `Rgba16Float` scene color target. - Add a fullscreen ACES tonemap + gamma pass into the surface. - Built-in PBR and world-environment shaders now output linear HDR; ACES moved to post. - 3D material and sky pipelines now target `SCENE_COLOR_FORMAT` (`Rgba16Float`); 2D/UI/text/overlay renderers still target the surface and therefore stay after tonemapping. - The sky pass always clears the scene color target, even when no environment is configured, so a reused HDR texture cannot leak the previous frame. - Add `tonemap.wgsl` to the naga-based WGSL validation tests. This is the prerequisite for FXAA/SMAA, bloom, volumetrics and SSR. ## Verification - `cargo fmt --all -- --check` - `cargo clippy -p orbital_renderer -p orbital_app -p orbital_model -p orbital_world_environment -p orbital_shader_pbr -- -D warnings` - `cargo test -p orbital_renderer -p orbital_app -p orbital_model -p orbital_resources --no-fail-fast` - `cargo check -p template_minimal -p template_all_in_one -p template_2d` - GUI examples were not launched in this environment (no display/GPU). Refs #647, #781.
feat(renderer): render the scene into HDR and tonemap in post
All checks were successful
Lint / lint (pull_request) Successful in 1m12s
PR / test (pull_request) Successful in 2m50s
6c2bec4abf
Add a Rgba16Float scene color target from the texture pool and a fullscreen ACES tonemap pass into the surface. Built-in PBR and world-environment shaders now output linear HDR; tonemapping and gamma are applied once in the post pass.

3D material and sky pipelines now target the HDR scene format. 2D, UI, text and overlay renderers still target the surface and therefore stay after tonemapping.

Add WGSL validation for the tonemap shader.

Smart test results

Result: PASS

Scope: orbital_app, orbital_model, orbital_renderer, orbital_resources, orbital_shader_pbr, orbital_world_environment

Reason: directly changed crates

Elapsed: 1m 45s

Workflow run

Overall: 46 tests, 45 passed, 0 failed, 1 skipped

Nextest: 45 tests, 45 passed, 0 failed, 0 skipped
Doctests: 1 tests, 0 passed, 0 failed, 1 skipped

Outcome charts are split between nextest and doctests. The timing chart covers nextest only.

Crate Nextest Passed Failed Skipped Doctests Time
orbital_app 10 10 0 0 0/1 0.07s
orbital_renderer 3 3 0 0 - 0.02s
orbital_resources 19 19 0 0 - 0.15s
orbital_world_environment 13 13 0 0 - 0.08s
pie showData
    title Nextest outcomes
    "Passed" : 45
pie showData
    title Doctest outcomes
    "Skipped" : 1
xychart-beta
    title "Slowest crates (nextest seconds)"
    x-axis ["orbital_resources", "orbital_world_environment", "orbital_app", "orbital_renderer"]
    y-axis "Seconds" 0 --> 1
    bar [0.15, 0.08, 0.07, 0.02]
<!-- orbital-ci-test-results --> ## Smart test results **Result:** PASS **Scope:** orbital_app, orbital_model, orbital_renderer, orbital_resources, orbital_shader_pbr, orbital_world_environment **Reason:** directly changed crates **Elapsed:** 1m 45s [Workflow run](https://forgejo.sakul-flee.de/SakulFlee/Orbital/actions/runs/643) **Overall:** 46 tests, 45 passed, 0 failed, 1 skipped **Nextest:** 45 tests, 45 passed, 0 failed, 0 skipped **Doctests:** 1 tests, 0 passed, 0 failed, 1 skipped _Outcome charts are split between nextest and doctests. The timing chart covers nextest only._ | Crate | Nextest | Passed | Failed | Skipped | Doctests | Time | | --- | ---: | ---: | ---: | ---: | ---: | ---: | | orbital_app | 10 | 10 | 0 | 0 | 0/1 | 0.07s | | orbital_renderer | 3 | 3 | 0 | 0 | - | 0.02s | | orbital_resources | 19 | 19 | 0 | 0 | - | 0.15s | | orbital_world_environment | 13 | 13 | 0 | 0 | - | 0.08s | ```mermaid pie showData title Nextest outcomes "Passed" : 45 ``` ```mermaid pie showData title Doctest outcomes "Skipped" : 1 ``` ```mermaid xychart-beta title "Slowest crates (nextest seconds)" x-axis ["orbital_resources", "orbital_world_environment", "orbital_app", "orbital_renderer"] y-axis "Seconds" 0 --> 1 bar [0.15, 0.08, 0.07, 0.02] ```
SakulFlee changed target branch from feat/renderer-phase-2 to main 2026-10-26 02:57:49 +00:00
SakulFlee deleted branch feat/renderer-hdr-post 2026-10-26 02:58:34 +00:00
Sign in to join this conversation.
No description provided.