[Bf-committers] OpenEXR in Blender's CVS

Gernot Ziegler gz at lysator.liu.se
Sun Mar 13 13:15:03 CET 2005


Hej folks !

After some stealth operations on #blendercoders I managed to sneak
OpenEXR into Blender CVS, exploiting Kents' goodwill and not to everyone's
delight ;) ... To post-formalize the whole thing, I would like to document
a bit here:

OpenEXR, as provided & documented on www.openexr.org , is a layer-based
image format used introduced by Industrial Light & Magic and other film
industry in Hollywood to store High Definition Range (HDR) Images.

It's basic idea was to introduce a new, smaller 16bit floating point
format they call "Half". This is what they usually use for their pixel
components (float and unsigned int also exist, but are not always
written/read by applications).

The data can be compressed losslessly. There is also a lossy fileformat
based on Wavelets.

All data is stored in named layers, so there usually is a layer "R", "G"
and "B" in every file. "A" and "Z" (depth) are other possible layers.
---
I have recently implemented a minimalistic OpenEXR output plugin to
fulfill my own egoistic needs (which are: get depth data out of Blender's
renderer for some research ;) ), and found such good response to it
that I worked together with Kent to put it into CVS.

It is integrated into imbuf, and provides a new output format option,
OpenEXR.
Currently, it outputs losslessly compressed OpenEXR files with
the components "R", "G", "B", "A" and "Z". All components are in the range
0.0 - 1.0, where Z has near=0.0 and far=0.0 .

NOTE: First when you activate "FBuf" you will be able to see the strengths
of the format, because then it will output the renderer's unclamped float
values !

It is also capable of reading OpenEXR RGBA-channels (other layers are
ignored), but I am not sure if I provide everything needed, please tell
me if something is missing.

Here are some shots (they need to be moved to the Blender site if they
shall remain as docs):
New option: http://www.lysator.liu.se/~gz/openexr/pluginshot1.png
Loader in action: http://www.lysator.liu.se/~gz/openexr/pluginshot2.png

these two shots show how OpenEXR captures HDR data:
http://www.lysator.liu.se/~gz/openexr/cylblock_normalexp.png
converted 0.0-1.0 to 0-255  - see the overexposed region ?

http://www.lysator.liu.se/~gz/openexr/cylblock_lowexp.png
converted 0.0-0.2 to 0-255 - the overexposed region actually contains more
data if "amplified" :-)

The other two are the data files.
It would be interesting to see if Cinepaint is capable of loading the
EXR file.

Implementation:
I introduced a new openexr.cc in
blender/source/blender/cv

Blender devs:
To use OpenEXR, you need to download and install OpenEXR libs
(www.openexr.com). Then, in SCons, remove config.opts, start scons,
interrupt, edit config.opts, activate use_openexr=true, start scons.
Makefile integration was done by Kent.

To test:
.) load the .blend-file from above
.) choose, OpenEXR, activate "FBuf" (!)
.) render file - voila, a new .EXR-file !  (console gives debug output)

Left to do:
Documentation in CMS, under
http://www.blender3d.org/cms/Changes_Since_2_36.496.0.html
http://blender3d.org/cms/Installation_Policy.352.0.html
(can the CMS people please contact me for this ?)

Future directions:
IEEE 32bit Float output ?
More data channels, like normals ?
_Several_ depth layers ?
Matting layers ?
Depth map loader ?
Camera Meta-information in header ?

We might want to ask the OpenEXR list or the CinePaint guys on what they
(thus: movie industry !) want to have.

And: Python bindings ! If the Python guys contact me I can help them to
integrate it. (actually I might need it myself soon)

Servus,
  Gernot

PS: I have to warn that my job may require me to leave the list again due
to time constraints, but I am always available under the e-mail above.

-- 
T----------------------------W-E-L-C-O-M-E------------------------------T
O  The Austria <=> Sweden <=> Germany <=> Netherlands connection.....   H
|  http://www.mpi-sb.mpg.de/~gziegler | http://lysator.liu.se/~gz       E
\-----------------------------F-U-T-U-R-E-------------------------------/


More information about the Bf-committers mailing list