cycles encoded hdr

Hello.

i was a bit curious to why i never got any sharp shadows with cycles so i started to poke around in the source code files since i was sure that it only loaded .hdr/exr files as 8bit/channel and unfortunately i was right.
so i remembered an old method of encoding hdr images using an extra alpha channel from some old opengl code i did. got it implemented into a script and a shader node tree.
here is a comparison of with and without the encoded hdr image same settings on both images other than it using my encoded format in the top image an a regular .hdr loaded in the lower.




more examples: http://imageshack.us/g/100/withouthdrstr30.png/

now to use this just go into the uv/image editor and load your .hdr/exr file and press image->use as hdr environment or one of the 2 other options i added do keep in mind that this conversion process might take a little while and will save the new encoded images as imagename_exp.png imagename_rgb.prg without asking if you want to save over the files if they were to exist before.

as for the math for decoding it if anyone wants to do it themselves.
rgb*(pow(2,(exp-0.5)*255) = hdr rgb and the images need to be set to linear so any color correction has to be done after decoding the rgb values.

Attachments

image_encodehdr.zip (2.48 KB)

good to see that its being sorted without any such tricks like i did here :wink:
well it was just meant to be a temporary workaround for now anyway and it was almost fun to make :smiley: (i hate python)

Thank you for your add-on FredrikH,
waiting for the correct usage of HDRs, I found this script very useful and interesting, and for the versatility of his node setting, it could be helpful also when 32 Bit images will work at full.

paolo