Skip to content

Do we need a enableHDR flag? #26071

@Mugen87

Description

@Mugen87

Description

I want to add better support for RTT in HDR setups.

Post-processing and other RTT example code currently use RGBA8 render targets in most cases. However, this configuration does not support HDR and can introduce banding artifacts.

The banding artifacts can be fixed by using SRGBA8 render targets (meaning UnsignedByteType + SRGBColorSpace) or by using half float render targets (via HalfFloatType). The latter one also supports HDR.

The problem is without knowing whether the application uses HDR or not, it's not possible to distinct between SRGBA8 and FP16.

Solution

Introduce a new flag enableHDR on renderer or composer level so it's possible to setup correct render targets.

Alternatives

  • Always use half float. There is a performance impact when doing this though because using half float is a bit more costly than SRGB8. However, this should be measured since when the difference in performance is only small, I would suggest to always use half float (e.g. as the default in EffectComposer and built-in passes)

  • Maybe we can evaluate which type of inline tone mapping is configured via WebGLRenderer.toneMapping? In a proper HDR post-processing scenario right now, the property should be NoToneMapping though (and tone mapping applied via a post-processing pass).

Additional context

There is a bug with SRGB8 render targets and M1 chips, see https://bugs.chromium.org/p/chromium/issues/detail?id=1329199&q=&can=2. The flickering also happens with M2 chips since I see it with Chrome on a M2 Pro mac Mini. Because of this we can't safely use SRGB8 render targets at the moment.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions