Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement filmic color grading. #13121

Merged
merged 5 commits into from
May 2, 2024
Merged

Commits on Apr 28, 2024

  1. Implement filmic color grading.

    This commit expands Bevy's existing tonemapping feature to a complete
    set of filmic color grading tools, matching those of engines like Unity,
    Unreal, and Godot. The following features are supported:
    
    * White point adjustment. This is inspired by Unity's implementation of
      the feature, but simplified and optimized. *Temperature* and *tint*
      control the adjustments to the *x* and *y* chromaticity values of [CIE
      1931]. Following Unity, the adjustments are made relative to the [D65
      standard illuminant] in the [LMS color space].
    
    * Hue rotation. This simply converts the RGB value to [HSV], alters the
      hue, and converts back.
    
    * Color correction. This allows the *gamma*, *gain*, and *lift* values
      to be adjusted according to the standard [ASC CDL combined function].
    
    * Separate color correction for shadows, midtones, and highlights.
      Blender's source code was used as a reference for the implementation
      of this. The midtone ranges can be adjusted by the user. To avoid
      abrupt color changes, a small crossfade is used between the different
      sections of the image, again following Blender's formulas.
    
    A new example, `color_grading`, has been added, offering a GUI to change
    all the color grading settings. It uses the same test scene as the
    existing `tonemapping` example, which has been factored out into a
    shared glTF scene.
    
    [CIE 1931]: https://en.wikipedia.org/wiki/CIE_1931_color_space
    
    [D65 standard illuminant]: https://en.wikipedia.org/wiki/Standard_illuminant#Illuminant_series_D
    
    [LMS color space]: https://en.wikipedia.org/wiki/LMS_color_space
    
    [HSV]: https://en.wikipedia.org/wiki/HSL_and_HSV
    
    [ASC CDL combined function]: https://en.wikipedia.org/wiki/ASC_CDL#Combined_Function
    pcwalton committed Apr 28, 2024
    Configuration menu
    Copy the full SHA
    cd924fc View commit details
    Browse the repository at this point in the history

Commits on Apr 30, 2024

  1. Configuration menu
    Copy the full SHA
    4b2f4db View commit details
    Browse the repository at this point in the history
  2. Address review comments

    pcwalton committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    1e60260 View commit details
    Browse the repository at this point in the history

Commits on May 2, 2024

  1. Configuration menu
    Copy the full SHA
    508c5d9 View commit details
    Browse the repository at this point in the history
  2. Doc check police

    pcwalton committed May 2, 2024
    Configuration menu
    Copy the full SHA
    82fee54 View commit details
    Browse the repository at this point in the history