derkreature/IBLBaker

IBLBaker returns .dds with negative float values

Opened this issue · 2 comments

I have a .hdr file that when run through IBLBaker produces an output image containing negative values. For the image I tried, this is specifically only in the green channel. These negative values result in artifacts when I go on to BC6H-compress the images IBLBaker produces (bright green splotches in this case). I assume it's not expected that any of IBLBaker's output images should contain negative values?

The source .hdr
The output specular HDR map containing negative values

The diffuse HDR map and EnvHDR map appear to be fine. I haven't looked at the MDR maps as I don't use them.

My settings:
IBLBaker settings

Let me know if there's any additional information I can provide.

Commenting out the hue and saturation adjustment code in ImportanceSamplingSpecular.fx (lines 169-190) appears to resolve the issue. So the culprit probably lies in those ~6 lines of code.

Yeah, good catch! That code was implemented to mess with LDR cubemaps back around 2012 :)