bevyengine / bevyengine/bevy

Skybox is not tonemapped in the LDR path

Open
#24,450 0 comments 0 reactions 0 assignees View on GitHub
A-Rendering C-Bug S-Needs-Investigation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## Bevy version and features

Bevy main using default Bevy features.

## What you did

I rendered a `Skybox` with a non-HDR `Camera3d` and changed the camera `Tonemapping` method.

## What went wrong

I expected the skybox to be affected by the camera tonemapping, the same way PBR meshes in the LDR path. Instead, changing the `Tonemapping` component has no visible effect on the skybox when HDR is disabled.

When HDR is enabled, the skybox is affected by the regular post-process tonemapping pass. The issue is specific to the LDR path.

## Additional information

One possible shader-side fix would be to apply tonemapping in `skybox.wgsl`, similarly to the PBR path:

```wgsl
#ifdef TONEMAP_IN_SHADER
output_color = tone_mapping(output_color, view.color_grading);
#endif
```

However, this small WGSL change is not sufficient on its own, because the skybox pipeline does not currently define `TONEMAP_IN_SHADER`. So the apparent fix in `skybox.wgsl` is simple, but the actual fix requires a fair amount of plumbing in the skybox render pipeline.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.