Page MenuHome

GPU: Add Image property to allow high bitdepth support on a per image basis
ClosedPublic

Authored by Clément Foucault (fclem) on Feb 19 2020, 6:07 PM.

Details

Summary

This adds the Half Float Precision option in the image property panel.
This option is only available on float textures and is enabled by default.

Adding a flag inside the imbuf (IB_halffloat) on load is done for EXR and PSD formats that can store half floating point (16bits/channels).
The option is then not displayed in this case and forced.

Related task T73086

Diff Detail

Repository
rB Blender

Event Timeline

I would consider automatic handling of half float cases in scope of this patch, or at least something that should be committed alongside this.

The option should at least be enabled by default for existing files, to avoid having renders that worked before run out of memory.

  • Add support for detecting half float exr and psd files

I've added support for detecting the half floats for EXR and PSD as it seems they are the only format that can support them. The other formats are using 16bits normalized int encoding or RGBE encoding (hdr). I don't know about dpx/cineon but I would guess they are normalized ints.

Since normalized ints can have better precision than half floats I prefer to keep the option visible.

The parameter is using inverted boolean so it's disabled by default (using low precision by default).

source/blender/gpu/intern/gpu_draw.c
331–333

Is this test correct? I would expect:

(!(main_ibuf->flags & IB_halffloat) || (ima->flag & IMA_HIGH_BITDEPTH))
Brecht Van Lommel (brecht) requested changes to this revision.Feb 25 2020, 2:51 PM
Brecht Van Lommel (brecht) added inline comments.
source/blender/gpu/intern/gpu_draw.c
331–333

Sorry, that should be:

(!(main_ibuf->flags & IB_halffloat) && (ima->flag & IMA_HIGH_BITDEPTH))
This revision now requires changes to proceed.Feb 25 2020, 2:51 PM
This revision is now accepted and ready to land.Feb 25 2020, 3:08 PM