godot-docs icon indicating copy to clipboard operation
godot-docs copied to clipboard

Viewport.use_hdr_2d is no longer useless with Compatibility renderer

Open PureAsbestos opened this issue 8 months ago • 0 comments

Your Godot version: 4.4.1.stable

Issue description:

The Viewport classref states:

Note: This setting will have no effect when using the Compatibility renderer, which always renders in low dynamic range for performance reasons.

However, this setting does have an effect in recent versions of Godot. This change seems to originally be due to this PR: https://github.com/godotengine/godot/pull/87360

This PR also enabled/abuses the 2D HDR setting on viewports to cause the viewport to use an RGBA16F buffer allowing for high dynamic range for both 2D and 3D output. Colors are still output in sRGB color space so it's more an approximation but it works.

Additionally, it seems to use a 32 bit buffer for me (get_texture().get_image().get_format() returns FORMAT_RGBAF not FORMAT_RGBAH)

I'm not sure if there are any remaining limitations to using this setting with the Compatibility renderer.

URL to the documentation page: https://docs.godotengine.org/en/latest/classes/class_viewport.html#class-viewport-property-use-hdr-2d

PureAsbestos avatar Apr 26 '25 11:04 PureAsbestos