What follows is a simple step by step guide to set up your project for OpenEXR output in Cinema 4D in a way that makes sure the linear workflow is kept intact from the render to the compositing in After Effects (or other similar apps).
Open your Project Settings either through the menu Edit > Project Settings… or by pressind Ctrl-D (for OSX it’s usually the same shortcut, only it’s Cmd instead of Ctrl). Here, make sure that Linear Workflow is checked and that the Input Color Profile is set to sRGB. This should be the default setting in Cinema 4D these days, but it’s better to check and be sure.
Background (skip if you don’t care): Linear workflow refers to the absence of gamma correction from you color workflow. Right. So what is gamma correction about. Our eyes read brightness not in a linear fashion. A doubling of light does not mean a doubling of brightness. What appears as 50% grey to us is actually just 18% grey. Gamma correction takes the fact that we recognize brightness on a curve into account and encodes colors accordingly, so we have more shades of those colors available where we actually notice the difference, and fewer where we wouldn’t notice anyway. This is great from a visual perspective (quite literally so), but not so much from a computer’s or camera sensors. Neither really care for our eyes’ lack of linear reception. And having to constantly add and substract gamma curves can cause all kinds of color shifts, even more so when there are slight variations in the methods these are applied or even worse, different gamma values. So what is being done instead is to internally treat all color linear, without gamma. 50% grey is 50% grey, everywhere. And thanks to 32 bit value ranges we have plenty of room for pretty much every color value, unlike in the days of 8 bit where we had 256 grey values and that was that. So, to get back to the project settings, what we set up here is this: we tell Cinema 4D to internally calculate everything in a linear fashion (Linear Workflow checked on), but to also expect textures and stuff coming from outside to be using the sRGB profile (which is the linear color multiplied by a gamma curve of 2.2) or whatever other profile is embedded inside the image file. This means you can work in Photoshop etc. as usual, save your sRGB based images (which is what you mostly work in when you work on a computer monitor) and give them over to Cinema 4D without thinking about color profiles. Beware though: if you use HDRI for lighting, those usually come as 32bit HDR or EXR files that are linear and not sRGB! So for those you have to make sure their profile is set to linear (which usually Cinema 4D does automatically).
JPG, PNG… textures are usually encoded with sRGB. Since this is the default settings, nothing should need to be done. In 99% of all cases the fact that the file is using sRGB is embedded in the metadata and the default “Color Profile” setting of “Embedded” will recognize this.
Same goes for EXR, which are always linear.
If in doubt check the preview image. The wrong color profile will almost always look very significantly off.
Little tip: right click on the preview image and click on “Open Window…”. It’ll open the preview in a separate, scalable window that’ll let you render larger previews.
There are a few things to look out for in the render settings.
Obviously Save and Multi-Pass should be checked, with all needed passes added to the Multi-Pass. Since we want everything in a single multi-layer OpenEXR file, make sure to also add an RGBA Image pass to your multi-pass and to disable the Save under Regular Image. Otherwise you get an additional file with another Beauty pass, which just clutters up the folder and isn’t needed.
Make sure under Multi-Pass-Image you changed the Format to OpenEXR. It’s always 32bit. Check the Multi-Layer File box, otherwise you get one separate EXR file per pass. Layer Name as Suffix does not have any effect on multi layered files, but leave it checked on just in case. Straight Alpha should be left on if you need to composite the render on top of something else. It’ll give you a clean alpha channel that is not tinted by the background, unlike a premultiplied alpha. Use Premultiplied (Straight alpha unchecked) only if you know exactly what the background color will be and you rendered the image on the very same background.
Important: if, like in the screenshot, the Regular Image file format was set to something other than OpenEXR, the Image Color Profile was probably defaulting to sRGB. Even though it is not obvious, the Regular Image’s Image Color Profile will affect the Multi-Pass Image too! Thus, it needs to be set to Linear Color Space manually! Otherwise you end up with sRGB embedded into your EXR and have to manually counteract that again in After Effects, causing all kinds of confusion…
If all went well we should now end up with a single file EXR that contains all the passes, is compressed and uses linear gamma. This is perfect for compositing for several reasons. As explained, linear workflow prevents color shifts between applications or even inside a single application. A single file per frame also prevents chaos, where otherwise for every frame there would be 20 files in a folder (making it 20.000 in a 1000 frame sequence). And also the compositing app only needs to cache and access a single file as compared to many, which can make a big difference over a network.
Just like in Cinema 4D, your first action should be to set up the project correctly. Go to File > Project Settings… and under Color Settings change the Working Space to sRGB IEC61966-2.1 and check the Linearize Working Space box. Now we have basically the same setup that we have in Cinema 4D. Ideally you could now also work in 32 bits per channel depths, but this is very memory intensive and may slow things down quite a bit. It shouldn’t matter now (except for some Layer Effects that behave differently in different depths! Trial and error….)
Import the EXR sequences as normal. Then right click and Interpret Footage. For some reason AE never guesses the Alpha right on a straight alpha EXR, so change that to Straight – Unmatted. (in the screenshot the Frame Rate is greyed out because it was a single still image, usually you’d have to set the correct frame rate here)
More important though are the Color Management settings. Assign the sRGB IEC61966-2.1 profile and change the Interpret As Linear Light to On (not just for 32 bit).
If you add non-linear files (files that use sRGB encoding for example) to the project, set everything up as above but change the Interpret As Linear Light to Off (which AE should do by default).
Accessing the Layers in the EXR
Accessing the layers in a multi-layer EXR is being done through the “EXtractoR” effect, which is basically a stripped down version of the ProEXR plugin that comes with AE. You can find it under Effect > 3D Channel > EXtractoR. Add the EXR to your comp and add the EXtractoR effect to the layer like so:
Click not where it tells you to click (I know…) but below, where it lists the Red/Green/Blue channels. A new dialog pops up.
Under Layers you should see all your multi-pass renders. In the case of RGB passes like Reflection, Diffuse etc. the dialog will fill out the Red, Green, Blue and Alpha channel automatically with the correct layer. Object Buffers however only have a single color channel and this trips up the dialog. No worries though, just set Red, Green, Blue to the Object Buffer’s Y channel (Y for luminance). Leave the alpha on (copy), since the Object Buffers don’t have an alpha channel (they are full frame greyscale where black = alpha).
Duplicate the layer as many times as required to get all your passes. Now you have every pass on a layer, but AE only has to read a single file for all those.
This should be all, things should now look correctly from render to output! But don’t trust my word for it.
Here’s how the image looked in the Cinema 4D picture viewer:
And here’s the same in AE:
And here’s a screenshot from an MP4 generated from that same comp:
Looks the same to me. Success