I’m looking at imageProcessing.fragment.fx’s code and can’t understand its inner workings. The code looks like this:
#ifdef IMAGEPROCESSING #ifndef FROMLINEARSPACE // Need to move to linear space for subsequent operations. result.rgb = toLinearSpace(result.rgb); #endif result = applyImageProcessing(result); #else // In case where the input is in linear space we at least need to put it back in gamma. #ifdef FROMLINEARSPACE result = applyImageProcessing(result); #endif #endif
I don’t understand what’s happening in the outmost
else block. If image processing is disabled,
applyImageProcessing should not be happening in any case. The comment above the line suggests
result.rgb = toGammaSpace(result.rgb), but not
result = applyImageProcessing(result).
Does anybody know what’s happening there and also why?