Friday, June 24, 2022

TONE MAPPING

This post is requested by Midnight Arrow at bitbucket to explain tone mapping in relation to material conversion. Below there's some reference.

http://www.digitaldog.net/

https://docs.omniverse.nvidia.com/app_create/prod_materials-and-rendering/render-settings_post-processing.html

https://docs.blender.org/manual/en/latest/render/color_management.html

https://bitbucket.org/Diffeomorphic/import_daz/issues/22/basic-tone-mapping


One feature of the diffeomorphic importer is that it converts materials from iray to cycles and eevee. This means that you can reasonably expect that your blender materials will be similar to daz studio. Then lights and cameras are converted as well, together with the notorious ghost lights. So your daz scenes will mosttly retain in blender the same look they have in daz studio.

What is not converted is tone mapping. Because there's no easy way to do it, and also because tone mapping is application specific and usually the tone mapping features are decided at render time depending on the project.

Q1. So what it is tone mapping and how does it affect materials and rendering ?

A1. Well tone mapping is how the rendered image is mapped on the output device. That is, a rendered image is defined in a linear color space that can store all the possible physics colors. Then your monitor can't reproduce all those colors so the rendered image is "shrinked" to fit the monitor palette. Technically this is called a linear to srgb transfer function that's what tone mapping does.


Below there's an example of tone mapping in daz studio with the default settings. We can see that the sphere and the background hdri are partially overexposed. This means that the tone mapping in iray doesn't map those colors in the output space of your monitor and they're all white.

You can find the daz test scene in the bitbucked link above. This scene needs the standard genesis package to be installed, plus it uses the standard srgb reference at digital dog, where you can also find lots of good articles.



Below there's the same scene imported via diffeomorphic and rendered in cycles. Here we use the default filmic view transform that's the blender tone mapping. We can see that the filmic view maps more colors to the monitor and the image is less overexposed.



We can get in blender a tone mapping similar to the iray default by using the standard view instead of the filmic view, with a medium low contrast look. Below there's the scene and the settings. We can see that now the colors and lights are more similar to iray.



Q2. Then why diffeomorphic doesn't force the standard view to mimic iray ?

A2. Because the iray tone mapping is not "fixed", it has many parameters that the user can fiddle with depending on the final look he wishes to get. And the standard view only mimics the default iray parameters that will mostly change. Unfortunately there's no easy way to convert the iray tone mapping parameters into the blender tone mapping parameters.


edit. note. As noted by William Hurst at bitbucket, tone mapping is usually done in post production. Both in daz studio and blender to avoid tone mapping it is possible to render to exr, that's hdri images without tone mapping. Then the tone mapping can be done in the post production application, as gimp or the blender compositor for example, or any application that can handle hdri images.