Make Tonemapping::None a passthrough and add Tonemapping::Linear - #25499
Make Tonemapping::None a passthrough and add Tonemapping::Linear#25499stuartparmenter wants to merge 2 commits into
Conversation
14b8ca9 to
84fa137
Compare
JMS55
left a comment
There was a problem hiding this comment.
- What code makes Tonemapping:Linear apply color grading/exposure/etc, but not Tonemapping::None?
- Not sure how I feel about this PR overall. I get why you need it, but Tonemapping::None not doing color grading and really/especially exposure feels wrong.
|
|
||
| match key.tonemapping { | ||
| Tonemapping::None => shader_defs.push("TONEMAP_METHOD_NONE".into()), | ||
| Tonemapping::None | Tonemapping::Linear => { |
There was a problem hiding this comment.
The shader def only picks the tone curve, and TONEMAP_METHOD_NONE means the identity curve. That's exactly what Linear is, so Linear maps to it. None still hits this match because the pipeline is prepared for every view, but the node never dispatches it (so that arm is dead in practice). I can rename the def to TONEMAP_METHOD_LINEAR if that reads better?
The camera's Exposure component is applied in the lighting pass and isn't changed. AutoExposure requires Hdr, where None already bypassed it. The only real change here is an SDR camera that pairs None with a custom grading exposure, and switching to Linear solves that. |
Objective
Tonemapping::Nonedoesn't actually turn everything off. The SDR in-shader path still applies color grading and dither, and clamps negative color channels to zero. The HDR work needs a real off switch, for example to send exact calibration patterns to the display unmodified.Solution
Tonemapping::Nonebecomes a full passthrough. Cameras that used it withColorGradingorDebandDithercan switch to the newTonemapping::Linear, which keeps grading, dither, and the clamp under an identity tone curve. Default cameras render unchanged.Testing
Check, clippy, and tests pass
This PR was built by me with the assistance of Claude Code w/ Fable 5