Author Topic: dubcats secret little hideout  (Read 116833 times)

2018-03-13, 09:21:31
Reply #165

dubcat

  • Active Users
  • **
  • Posts: 460
  • ฅ^•ﻌ•^ฅ meow
    • View Profile
I had a dream last night, I made a new IOR map generator. It supported IOR up to 1.8. So if you scanned a concrete wall or asphalt, the small stones would get higher IOR then 1.5.
If you have cross polarized a composition material before, you know what I'm talking about.
So the first thing I did today after some coffee, was to remake that generator, and it has basically changed the way I create PBR textures.

Here are some reflection tests

No IOR Map



Official Megascans Specular Map converted to IOR



My new Generator.
You might notice the gem stones in the asphalt, and you can see how everything looks more defined and crisp.
It basically looks like a real cross polarized specular photo.

             ___
    _] [__|OO|
   (____|___|     https://www.twitch.tv/dubca7 / https://soundcloud.com/dubca7 ( ͡° ͜ʖ ͡°)

2018-03-13, 09:45:15
Reply #166

WAcky

  • Active Users
  • **
  • Posts: 41
    • View Profile
Love seeing this thread progressing. Dubcat thank you for all the work. Do you have any recommended reading on getting started with creating one's own scanned materials? IE polarized lights/filters etc etc?

Cheers!

- James

2018-03-13, 10:14:26
Reply #167

dubcat

  • Active Users
  • **
  • Posts: 460
  • ฅ^•ﻌ•^ฅ meow
    • View Profile
Do you have any recommended reading on getting started with creating one's own scanned materials?

Hey!

https://www.allegorithmic.com/blog/your-smartphone-material-scanner is a great starter guide.
They don't cover cross polarization. But if I remember correct, I made a how to on the forums somewhere.

You basically mount a linear polarizer sheet to your camera and light. Shot once, rotate the polarizer sheet on your light 90 degree, shot again.
One of the pictures contain "50% diffuse" and the other contains 100% specular + 50% diffuse.
Open both photos in Photoshop, convert to 32 bit mode (Need 32bit for correct linear math).
Subtract the "50% diffuse" photo from the "100% specular + 50% diffuse" photo, this is your spec map.
Take the "50% diffuse" photo and add it with itself once, this is your 100% diffuse map.

Repeat this process on all 4 angles, you end up with a nice albedo map and a glossiness map.
             ___
    _] [__|OO|
   (____|___|     https://www.twitch.tv/dubca7 / https://soundcloud.com/dubca7 ( ͡° ͜ʖ ͡°)

2018-03-13, 10:36:00
Reply #168

Fluss

  • Active Users
  • **
  • Posts: 452
    • View Profile
Nice stuff Dubcat, as always !

2018-03-13, 13:16:03
Reply #169

WAcky

  • Active Users
  • **
  • Posts: 41
    • View Profile
Magnificent. Thank you!

Do you have any recommended reading on getting started with creating one's own scanned materials?

Hey!

https://www.allegorithmic.com/blog/your-smartphone-material-scanner is a great starter guide.
They don't cover cross polarization. But if I remember correct, I made a how to on the forums somewhere.

You basically mount a linear polarizer sheet to your camera and light. Shot once, rotate the polarizer sheet on your light 90 degree, shot again.
One of the pictures contain "50% diffuse" and the other contains 100% specular + 50% diffuse.
Open both photos in Photoshop, convert to 32 bit mode (Need 32bit for correct linear math).
Subtract the "50% diffuse" photo from the "100% specular + 50% diffuse" photo, this is your spec map.
Take the "50% diffuse" photo and add it with itself once, this is your 100% diffuse map.

Repeat this process on all 4 angles, you end up with a nice albedo map and a glossiness map.

2018-03-13, 17:20:09
Reply #170

dubcat

  • Active Users
  • **
  • Posts: 460
  • ฅ^•ﻌ•^ฅ meow
    • View Profile
The new IOR generator is almost complete, this will be the final rev for today.

No IOR map



Old Specular to IOR map



New IOR Generator

             ___
    _] [__|OO|
   (____|___|     https://www.twitch.tv/dubca7 / https://soundcloud.com/dubca7 ( ͡° ͜ʖ ͡°)

2018-03-13, 17:22:06
Reply #171

fabio81

  • Active Users
  • **
  • Posts: 303
    • View Profile
Dubcat can I ask you something ?
do you usually apply the lut file to a 32bit or 16bit file? because I noticed that Corona when applying the lut is as if it added a gamma 2.2 and then applies the lut above.
Now I do not know if programs like nuke or fusion should do the same thing or apply the lut directly above the 32bit.
how do you do with Nuke or Corona?

thanks!

2018-03-13, 17:51:36
Reply #172

dubcat

  • Active Users
  • **
  • Posts: 460
  • ฅ^•ﻌ•^ฅ meow
    • View Profile
do you usually apply the lut file to a 32bit or 16bit file?

Hey!

If you are using Photoshop, convert the specular map to 16bit and apply the LUT. Load the bitmap as gamma 1.0

If you want to do everything inside 3dsmax, you have to load the specular map as gamma 1.0, use a ColorCorrection map to convert it to Linear, because of 3dsmaxs gamma mess. Apply the LUT, and convert it back to sRGB.



The new IOR generator is not a LUT. You can feed it scanned specular maps or old reflection level maps.
Will make a separate post on how to use it when it's ready.
             ___
    _] [__|OO|
   (____|___|     https://www.twitch.tv/dubca7 / https://soundcloud.com/dubca7 ( ͡° ͜ʖ ͡°)

2018-03-13, 17:59:22
Reply #173

fabio81

  • Active Users
  • **
  • Posts: 303
    • View Profile
thank you so much!

2018-03-16, 17:07:33
Reply #174

dubcat

  • Active Users
  • **
  • Posts: 460
  • ฅ^•ﻌ•^ฅ meow
    • View Profile
The new generator is almost complete.
It can generate IOR and Specular maps from 3 different map inputs so far.

#1 Cross Polarization Specular Scan
This is the best solution, your Corona render will have identical reflections to the real world cross polarized specular map.

This is the result



#2 Normal Map
This is the second best solution. If you don't have a cross polarized specular map, you can use this one.
You can use any existing normal map. It will generate a IOR / Specular map based on the normal map height strength.
This was initially Jurajs idea, and Ondra gave me some pro tips. So this generator would not exist if not for them!

This is the result



#3 Reflection Level
This is the shittiest last solution.
It will convert old reflection level maps to IOR/Specular. This will give you the same look as you had before, but it will not clamp fresnel.

Since the new generator also generate specular maps, we get real world reflection behavior in Unreal 4!



When everything is road tested and tweaked, I will compile them as 3 LUTs.
             ___
    _] [__|OO|
   (____|___|     https://www.twitch.tv/dubca7 / https://soundcloud.com/dubca7 ( ͡° ͜ʖ ͡°)

2018-03-16, 23:02:16
Reply #175

dubcat

  • Active Users
  • **
  • Posts: 460
  • ฅ^•ﻌ•^ฅ meow
    • View Profile
Thought I could share my custom metal settings. It's nice to get the correct scanned behavior from "refractiveindex.info", but the color values are way off. These are my current reference matched metal materials, these change every week, so it's more of a snapshot of my current settings.



















Gold Example:

« Last Edit: 2018-03-16, 23:05:37 by dubcat »
             ___
    _] [__|OO|
   (____|___|     https://www.twitch.tv/dubca7 / https://soundcloud.com/dubca7 ( ͡° ͜ʖ ͡°)

2018-03-20, 05:08:32
Reply #176

Basshunter

  • Active Users
  • **
  • Posts: 24
    • View Profile
Hi @Dubcat, very interesting topic. So, this "Specular map" would be used as Glossiness map right? And reflection slot full white?

2018-03-21, 16:27:28
Reply #177

dubcat

  • Active Users
  • **
  • Posts: 460
  • ฅ^•ﻌ•^ฅ meow
    • View Profile
"Specular map" would be used as Glossiness map right? And reflection slot full white?

Hey!
The IOR map is used in the "Fresnel IOR" slot and complements the glossiness map. They are both generated from the same cross polarized set of pictures.
Current PBR shaders can't emulate real world materials with just albedo/glossiness.
If you build a virtual material scanner inside Corona and scan your materials, you will see that the cross polarized specular does not represent real world at all.
My new IOR generator takes care of this problem.

Here are some examples from my last virtual 3d scanner test.

This is how I generate my maps



No IOR map Specular



IOR map Speulcar


Glossiness map generated from the material with no IOR Map



Glossiness map generated from the material with IOR Map

             ___
    _] [__|OO|
   (____|___|     https://www.twitch.tv/dubca7 / https://soundcloud.com/dubca7 ( ͡° ͜ʖ ͡°)

2018-03-21, 23:10:41
Reply #178

mferster

  • Active Users
  • **
  • Posts: 414
    • View Profile


If you build a virtual material scanner inside Corona and scan your materials, you will see that the cross polarized specular does not represent real world at all.

Wait, wait, wait! How did you simulate a cross polarization filter material in corona?

2018-03-22, 09:25:46
Reply #179

karnak

  • Primary Certified Instructor
  • Active Users
  • ***
  • Posts: 66
    • View Profile
@mferster

In Corona you don't need cross polarization to split diffuse reflection from specular reflection. You have render elements for that.
Conversely, in real-world you need cross polarization because your capture equipment (i.e. your camera) most likely won't have render elements. :D

I think dubcat is saying that when you compare the render element to the real-world cross-polarized photo, the two don't match at all.
He is using a method for processing scanned data, but looks like the inputs in his test are from Corona so he can iterate and change things faster.
Corona Academy (May 2017)