ACES and Substance Painter

So to clarify, you did:
Lin to log
Utility-linear-sRGB to Output-sRGB
log to Lin

Hey everyone,

just wondering if anyone who actually made the log tone mapper workflow work in Substance Painter could share a screenshot of their Nuke setup ?

I am not able to invert the log tonemapper in my LUT generation. It is either too dark or washed out for some reason. @bleleux @Derek @Dogway1

As you guys are well aware, without the log tone mapper inverted, highlights will clamp. I’d like to get rid of that… I have tried lots of combination of log2lin/lin2log in Nuke but none did the trick…

I’ll try again tomorrow with a fresh head.
Many thanks !

Hey @ChrisBrejon!
It’s a bit un-intuitive: to create a log shaper pre-lut on your lut image, you need to first apply the inverse log transform, then apply the color transform (your OCIODisplay in this case).

So your tree might look something like this:

I usually think about it like this: How do you get from the colorspace you will be applying the lut image in (Painter Log) to the colorspace that the color transform is applied in (ACEScg Linear)? You need a Painter Log to ACEScg Linear colorspace transformation. There are no more transformations to be done because once the Output Transform is applied you are where you need to be.

Hope that makes sense.
Anyway, I was poking around curiously at this same problem a few months ago. I’ll share what I came up with in the hopes it might help you, though I’m not convinced it is a perfect solution!

As far as I can tell, the Substance Painter tonemapping log curve is undocumented. I wasn’t able to get a perfect match with the usual suspects (simple log function, log2lin, cineon, acescct etc).

Without the math of that curve, or a good approximation of it, you obviously can’t do a forward or an inverse transform to get into or out of painter log. So I tried to reverse engineer the painter log curve by putting a linear ramp on a sphere, applying the log tonemapping in Painter with a Mapping factor of 64, and analyzing what happened to the displayed pixels. Not exactly elegant but I did manage to get a log curve out of it that at least seems to resemble the proper thing.

The log curve is here as an spi1d, and there is a lut image for the rec709 and p3d65 aces output transforms there as well if you want to test it out.

I’m pretty sure someone on here who is way smarter than me is going to come along with a better solution and an exact match for the log curve, but hey maybe this will help someone.

Let me know how it works!

Perfect ! That’s exactly the information I needed.

I definitely tried the setup from your screenshot and since it was not working as expected, this is where I tried different things that did not make much sense. I naively thought that Substance log curve was standard. :wink:

Your explanation makes perfect sense (as usual !) and is much appreciated !
I’ll let you know how this goes ! Many many thanks !

Chris

Certainly not any standard log curve I know. The toe begins well above mid grey.

Thank you @jedsmith ! it worked like a charm ! I used your nuke setup and replaced the Log2Lin node by an OCIOFileTransform reading your spi1d LUT. It is the first time I was able to really match an ACES render to the ACES viewport of Substance Painter (no highlights clipping). Ideally we would get the log curve from Allegorithmic to be more accurate. I have asked them. Thanks !

OCIO support is imminent AFAIK :slight_smile:

Substance Designer now supports OCIO indeed. But I have been told yesterday there was no eta for Substance Painter… Let’s juts hope then. :wink:

Here’s what the Allego’s documentation say :

  • Log : This results in mapping that is even more gradual than Reinhard , and contrast that is low. It causes the resolution of the high luminance components to become high, and the strongest reproduction of the luminance variations in the bright portions.
  • LogLum : Type for implementing the tone map of the logarithmic space with the luminance as the reference and keeping the original saturation (vividness: RGB ratio). This maps only the luminance information to the logarithmic space and then reproduces the original saturation. The saturation in the HDR space is also kept after tone mapping.

Not much of an help. But we have found out that this Log Function actually comes from Yebis. So I have written to them and they are investigating the matter.

Let’s wait and see :wink:

1 Like

Thanks for asking around to see if anyone will give us more information! :slight_smile:

I’m curious to hear if they reveal any secrets.

Unfortunately no secret revealed… @jedsmith Here is the answer I got :

One of the tone map curves provided by YEBIS, which is a YEBIS original function, is based on a logarithmic function. This is the most gentle curve in the YEBIS tone map, and has a low contrast. Therefore, it is easy to express a wide range of brightness. However, it’s not a very good curve from an artwork perspective.

That’s it ! Not much of an help :stuck_out_tongue:

1 Like

Quite an understatement! :slight_smile:

Hey,
Thanks to your instructions i managed to build the LUT on my side too .
Will @jedsmith and @ChrisBrejon allow me to share my result on my Gumroad (for free so i’m not selling it) to help people work with SP while waiting for OCIO support ?

Regards
Liam.

Yeah for sure! If it helps people I’m all for it. Post a link when you have it up.

Just out of curiosity, is your LUT for a view transform that is not in the repository? Or is it because you have a different working gamut than ACEScg? Just curious what your use-case is.

1 Like

Thanks !
First cause i wanted to just know how to do it , then to have the choice between working with sRGB or ACEScg primaries. (sRGB included a converting step after export but allow to keep the same workflow/tools in SP)

Good idea @MrLixm ! We did some LUTs for the studio based on a linear - sRGB working space, with a variation using the log tonemapper. I think it would be of great interest to list them all and have them available at one place for free.
Let me know if I can help,
Chris

1 Like

Here is the Instructions and the ReadMe that are going to be included with the LUTs. The work is shared under CC BY-SA license.(details in README).
Credits are included in the README.

LUT supplied are:

ODT: rec709, sRGB, P3D60, P3D65
WorkingSpace: Linear - sRGB, ACEScg

Don’t know what kind of other ODT are often used and could be added.

INSTRUCTIONS.txt (1.7 KB)
README.txt (1.0 KB)

Tell me if you notice anything wrong.

1 Like

One minor thing you could mention in the instructions: when you change the tone mapping function from linear to log, make sure to set the mapping factor from the default (32) to the maximum (63.99). This is what the spi1d curve was sampled from.

Looks good otherwise! Thanks for putting this together @MrLixm

1 Like

So here it is : https://gumroad.com/l/aces4sp
Unfortunately it seems that i can’t remove the “pay what you want feature” so it mean folks can pay the asset and I will receive money (beh who want money nowadays ?)
We can say that if there is any donation they will be donated to colour-science open collective ?
If this is too problematic I can remove the product and we find an other way to share it online.

1 Like

Yes for open collective : That’s a good thing ! Otherwise I could also upload them on my website. @MrLixm

It will be cool to have them shared on your website also !

1 Like