Corona Renderer for 3ds Max > [Max] Tutorials & Guides

Specular To IOR (OSL)

(1/2) > >>

dubcat:
Recently I got an email about Unreals new MetaHuman, so I thought I could begin to port all the shaders over to Corona for fun in my spare time.

All this porting made me realize how sick I am of the "offline renderer" bias towards IOR instead of Specular. Back when I was the main Corona exporter coder for Megascans, I made a "SpecularToIORv2.3dl" LUT to handle this problem.
Since then, 3dsMaxs OSL support has evolved, and we can do this stuff in engine.

Specular could be implemented in the new Corona Physical Material in a few minutes. We only need to remap pixel values from Specular to IOR, and everything will work as it is.

Specular = 0.5 is the same as IOR = 1.50
(0.08*Specular )*100 = 4 Reflectivity ----- (if Specular is 0.5)
1/((2/(sqrt((Reflectivity /100))+1))-1) = 1.50 IOR ----- (if Reflectivity is 4)

I've made an OSL that will handle all this stuff for you, but I really hope that we can get a switch in Corona to toggle between IOR/Specular.

"BONUS POST" "BONUS POST" "BONUS POST" "BONUS POST"

Roughness:

1. Epic generates a detailed roughness map from the normal map, using the "Composite Texture" part of a texture file in Unreal Engine 4. If you join the UE4 dev group on GitHub you can see the actual code. (and the Blue fix for ACES, wink, wink)

2. Epic custom paints a custom map with broad stokes, to specify what the base roughness value should be.

3. Epic blends the custom painted controlled roughness map with the "Composite Texture" roughness map.

4. Epic use a Fresnel to control and fade between the painted and generated map.



Specular:

1. Epic generates a Cavity map and remap it to specular values aka IOR.

I always go for cross polarizing specular maps. Cavity generated maps, and if I don't have anything else. I generate a spec map based on the normal map depth, maybe there are just a few pixels on the Z depth, but it's worth it.



Normal:

1. Epic has a normal map based on scans

2. Epic use a generated detailed "micro" scan. That kind of looks like your average leather sofa.

3. In our example. Epic use a gradient map, to make a mask that specify where the face detail should be, and where the neck portion should be. Because we want less micro detail bellow the neck.

4. Epic blends the scanned normal map with the Generated "leather sofa" map.



I've always been an advocate for IOR/Specular maps, and this is why!

Only Roughness (Corona Physical Material)



Roughness + IOR (Specular) (Corona Physical Material)



Roughness + IOR (Specular) + Normal



Roughness + IOR (Specular) + Normal + Albedo (Default SSS settings with 2cm)



I've over emphasized the IOR/Specular map in this example with no depth of field, just to show you how important this map is.

dfcorona:
Very cool dubcat, that MetaHuman software is amazing.  I'm also looking forward to UE 5, that might be a game changer.

arqrenderz:
Is it just me or the images on the post are not loading?

TomG:
Loading fine here.

Jpjapers:
Ive missed these dubcat posts. Nice work!

Navigation

[0] Message Index

[#] Next page

Go to full version