Author Topic: Looking for a tool to convert specular to IOR  (Read 376 times)

2022-06-22, 10:38:04

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 7693
  • Let's move this topic, shall we?
    • View Profile
    • My Models
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 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 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.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2022-06-22, 13:31:46
Reply #1

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 11414
  • Marcin
    • View Profile
I am trying to get some useful info for you... stay tuned! :)
Marcin Miodek | chaos-corona.com
Chaos Corona Support Team Lead | contact us

2022-06-22, 15:08:34
Reply #2

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 11414
  • Marcin
    • View Profile
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.

Marcin Miodek | chaos-corona.com
Chaos Corona Support Team Lead | contact us

2022-06-22, 16:12:49
Reply #3

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 7693
  • Let's move this topic, shall we?
    • View Profile
    • My Models
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!
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures