Skip to content

Debanding intensity too high in dark regions #6706

@aevyrie

Description

@aevyrie

Bevy version

Bevy 0.9

What you did

Run the 3d_scene example.

What went wrong

Noise introduced by deband dithering appears to be higher intensity than intended in dark regions.

image

Additional information

Deband dithering is only supposed to add noise within +/- step of a u8 color channel (1/256).

My hypothesis for the cause:

  • Because the target buffer is converted to sRGB automatically, we have to output our debanding result in linear space.
  • To do end up with only +/- one step of noise, we need to apply our gamma correction, apply noise, then invert the gamma.
  • However, we use an estimate of the sRGB gamma transform pow(output_rgb.rgb, vec3<f32>(1.0 / 2.2)); which is not accurate for darker values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenC-BugAn unexpected or incorrect behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions