Skip to content

Commit

Permalink
Merge pull request #1 from JMS55/tonemap_options
Browse files Browse the repository at this point in the history
Tonemapping example refactor
  • Loading branch information
DGriffin91 authored Feb 16, 2023
2 parents dad817f + 3d9bebf commit 2488305
Show file tree
Hide file tree
Showing 4 changed files with 298 additions and 361 deletions.
8 changes: 4 additions & 4 deletions crates/bevy_core_pipeline/src/tonemapping/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ pub struct TonemappingPipeline {
#[reflect(FromReflect)]
pub enum TonemappingMethod {
None,
/// Suffers from lots hue shifting, brights don't desaturate naturally.
/// Suffers from lots of hue shifting, brights don't desaturate naturally.
Reinhard,
/// Old bevy default. Suffers from hue shifting, brights don't desaturate much at all.
ReinhardLuminance,
/// Bad
Aces,
ACES,
/// Very Good
AgX,
/// Also good
Expand Down Expand Up @@ -123,7 +123,7 @@ impl SpecializedRenderPipeline for TonemappingPipeline {
TonemappingMethod::ReinhardLuminance => {
shader_defs.push("TONEMAP_METHOD_REINHARD_LUMINANCE".into());
}
TonemappingMethod::Aces => shader_defs.push("TONEMAP_METHOD_ACES".into()),
TonemappingMethod::ACES => shader_defs.push("TONEMAP_METHOD_ACES".into()),
TonemappingMethod::AgX => shader_defs.push("TONEMAP_METHOD_AGX".into()),
TonemappingMethod::SomewhatBoringDisplayTransform => {
shader_defs.push("TONEMAP_METHOD_SOMEWHAT_BORING_DISPLAY_TRANSFORM".into())
Expand Down Expand Up @@ -264,7 +264,7 @@ pub fn get_lut_bindings<'a>(
TonemappingMethod::None
| TonemappingMethod::Reinhard
| TonemappingMethod::ReinhardLuminance
| TonemappingMethod::Aces
| TonemappingMethod::ACES
| TonemappingMethod::AgX
| TonemappingMethod::SomewhatBoringDisplayTransform => &tonemapping_luts.agx,
TonemappingMethod::TonyMcMapface => &tonemapping_luts.tony_mc_mapface,
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_pbr/src/material.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ pub fn queue_material_meshes<M: Material>(
TonemappingMethod::ReinhardLuminance => {
MeshPipelineKey::TONEMAP_METHOD_REINHARD_LUMINANCE
}
TonemappingMethod::Aces => MeshPipelineKey::TONEMAP_METHOD_ACES,
TonemappingMethod::ACES => MeshPipelineKey::TONEMAP_METHOD_ACES,
TonemappingMethod::AgX => MeshPipelineKey::TONEMAP_METHOD_AGX,
TonemappingMethod::SomewhatBoringDisplayTransform => {
MeshPipelineKey::TONEMAP_METHOD_SOMEWHAT_BORING_DISPLAY_TRANSFORM
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_sprite/src/mesh2d/material.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ pub fn queue_material2d_meshes<M: Material2d>(
TonemappingMethod::ReinhardLuminance => {
Mesh2dPipelineKey::TONEMAP_METHOD_REINHARD_LUMINANCE
}
TonemappingMethod::Aces => Mesh2dPipelineKey::TONEMAP_METHOD_ACES,
TonemappingMethod::ACES => Mesh2dPipelineKey::TONEMAP_METHOD_ACES,
TonemappingMethod::AgX => Mesh2dPipelineKey::TONEMAP_METHOD_AGX,
TonemappingMethod::SomewhatBoringDisplayTransform => {
Mesh2dPipelineKey::TONEMAP_METHOD_SOMEWHAT_BORING_DISPLAY_TRANSFORM
Expand Down
Loading

0 comments on commit 2488305

Please sign in to comment.