Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] I need help! => Topic started by: romullus on 2022-06-22, 10:38:04

Title: Looking for a tool to convert specular to IOR
Post by: romullus on 2022-06-22, 10:38:04
Corona physical material gives you an option to chose between specular and IOR modes, unfortunately this functionality hasn't been ported back to old materials, like legacy, or skin, so i'm looking for a tool to convert specular textures to IOR. After some research i found this topic (https://forum.corona-renderer.com/index.php?topic=32445.0) by Dubcat. Since i'm using 3ds Max 2016, i don't have access to OSL, so i had to use his LUT file in Affinity Photo to convert textures externally (which is preferred method for me anyway). The problem is, that i couldn't manage to get correct results with it - it's either i don't know how to use it properly, or Affinity treats this LUT somehow differently.

Then i found this tool (https://mohseni.gumroad.com/l/frlDR) by Mohammadreza Mohseni, but virus total flagged it as malicious, so no use :/

At this point i'm out of ideas, so any help would be greatly appreciated.
Title: Re: Looking for a tool to convert specular to IOR
Post by: maru on 2022-06-22, 13:31:46
I am trying to get some useful info for you... stay tuned! :)
Title: Re: Looking for a tool to convert specular to IOR
Post by: maru on 2022-06-22, 15:08:34
Here it is:

Quote
Specular mapping: Disney Specular mapping uses the following formula: IOR = 2 / (1 - SQRT(Specular * 0.08)) - 1 and maps Specular in [0,1] to IOR in [1, 1.8].

You can use the above formula. Not sure what software you will use for the conversion, but you should be careful about the fact that the resulting texture will have values over 1.
If you want to avoid such issues, you can compute 1/IOR instead. When Corona gets IOR texture, it automatically inverts all values lower than 1, meaning it will internally turn 1/IOR texture to IOR texture.

The above info comes from our Magic Department, so if you have some further questions, please let me know and I will do my best to get the answers for you.

Title: Re: Looking for a tool to convert specular to IOR
Post by: romullus on 2022-06-22, 16:12:49
Thank you Marcin, but i kinda already knew the formula. The problem is i don't know how to apply it to the texture image. I guess the most logical way would be to build a LUT, but again, no idea how to do that. Anyway, i'll try to dig deeper and see if i manage to find the answers. Appreciate for your help!