Fix #120806: Clamp gamma when passed to OCIO #120807

Open
YimingWu wants to merge 1 commits from ChengduLittleA/blender:fix-120806 into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
1 changed files with 4 additions and 1 deletions

View File

@ -881,7 +881,10 @@ static OCIO_ConstCPUProcessorRcPtr *create_display_buffer_processor(const char *
OCIO_ConstConfigRcPtr *config = OCIO_getCurrentConfig();
const bool use_look = colormanage_use_look(look, view_transform);
const float scale = (exposure == 0.0f) ? 1.0f : powf(2.0f, exposure);
const float exponent = (gamma == 1.0f) ? 1.0f : 1.0f / max_ff(FLT_EPSILON, gamma);
float exponent = (gamma == 1.0f) ? 1.0f : 1.0f / max_ff(FLT_EPSILON, gamma);
if (exponent > 100.0f) {
exponent = 100.0f;
}
OCIO_ConstProcessorRcPtr *processor = OCIO_createDisplayProcessor(config,
from_colorspace,