Author Topic: Physically correct materials  (Read 16583 times)

2016-07-23, 16:34:12

Godzil

  • Active Users
  • **
  • Posts: 22
    • View Profile
    • ONE2 architekci
Hi guys!

I'd like to start a discussion about physically correct materials creation in Corona Renderer.
Lately I was enjoying the Grant Warwick's method of creating such in VRay. You know, the way where he disable VRay's Fresnel option and create one by himself using fallof map. Then he Blend few materials with different fallof map to create the GGX shader effect.

I was wondering is there a way to use this worflow in Corona renderer? Cuz I don't think it's possible to disable Fresnel in corona materials, am I right? I don't see any option to create my own reflective curve in Corona material. Blending materials in corona using AO or fallof as masks give great results, but what if I have charts that tells me how the correct reflective curve should look like and I would like to put it into the Corona? Or maybe there is another option that can help me createing realistic materials without eyeballing it?

What do you guys think?

2016-07-24, 15:42:07
Reply #1

Juraj

  • Active Users
  • **
  • Posts: 4743
    • View Profile
    • studio website
- Corona already has GGX (but wrong fresnel, read this thread first  https://forum.corona-renderer.com/index.php/topic,4010.0.html )

- Grant is not using that method anymore, no one actually is. Vray has GGX too.

- You can disable fresnel by  [Option 1]= Set fresnel to 999, [Option 2, slightly better= Use CoronaColor map set to HDR=999 in IOR map slot]

- You can then do the curves manually like Grant did, or you can use SigerShaders 'ComplexFresnel' plugin which lets you use complex IOR (n an K) for all RGB channels. This is more precise way of using ior data from refractiveindex.org.


But without correct fresnel (we don't have one yet) it's not gonna be the real deal. Read the first link :- ).
Please follow my new Instagram for latest projects, tips&tricks, short video tutorials and free models
Behance  Probably best updated portfolio of my work
lysfaere.com Please check the new stuff!

2016-07-24, 17:20:51
Reply #2

Godzil

  • Active Users
  • **
  • Posts: 22
    • View Profile
    • ONE2 architekci
Thanks! That clears things out a bit.
I am also TRYING to use GGX in VRay now but since a haven't seen any never Grant's lessons (yet) i'm running blind on how to use it properly.
Can you support me with any kind of VRay tutorials of how to create PBR shaders in VRay 3? I had no luck in finding something usefull :(

So yea... in your opinion i'm now trying to learn legacy method of doing things. Great :-/
So the question is: if the Corona has GGX but fresnel is wrong, how to correct this since you said that no one is using this method anymore?

My current method is:
1. I choose a reflective curve of a material I want to create.
2. I represent this curve in fallof map that is put in the reflective (fresnel is off).
3. I'm trying to eyeball correct setting for GGX (GTR tail fallof) but im not sure what i'm doing there, what to type in there.
I do not blend materials with different gloss. already since i heard that GGX can do this for me. But i'm still trying to re-create the propper fresnel. Is that method ok?

I would be super thankfull for any kind of practical help. Cuz in theory i think i do understand what I read in the 1st link (and other materials linked to it) but I still have a cloudy idea how to create a propper material.
 
« Last Edit: 2016-07-24, 17:25:30 by Godzil »

2016-07-25, 11:16:56
Reply #3

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
- You can disable fresnel by  [Option 1]= Set fresnel to 999, [Option 2, slightly better= Use CoronaColor map set to HDR=999 in IOR map slot]
Wait, there shouldnt be a difference, why do you think the second one is better?
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2016-07-25, 11:50:22
Reply #4

dubcat

  • Active Users
  • **
  • Posts: 425
  • ฅ^•ﻌ•^ฅ meow
    • View Profile
He is talking about the 999 IOR Tint.
I redid the test to see if it was fixed, but it's still the same.

999 IOR and ColorFix



Added some contrast

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

2016-07-25, 11:57:15
Reply #5

Godzil

  • Active Users
  • **
  • Posts: 22
    • View Profile
    • ONE2 architekci
Wow thanks guys.

And do you know anything about the main topic? Can anyone aid me in creating physically correct shaders in Corona? :)

2016-07-25, 12:08:50
Reply #6

dubcat

  • Active Users
  • **
  • Posts: 425
  • ฅ^•ﻌ•^ฅ meow
    • View Profile
Have a look at this Thread https://forum.corona-renderer.com/index.php/topic,11377.0.html

Diffuse
If you want to be safe, stay within 50 - 240 sRGB
If you feel a little bit daring, stay within 30 - 240 sRGB

Reflection
Always leave it at 1.

Glossiness
Use this map to control Reflection.

IOR
Start at IOR 1.50 (4% Reflectivity).
If you got correct diffuse values, and it is still not behaving as it should, go down to IOR 1.42 (3% Reflectivity).
Still not behaving as it should, go down to IOR 1.33 (2% Reflectivity).

Almost every texture that ship with Quixel Suite has an IOR of 1.33 (2% Reflectivity).

edit:fixed typo in Reflection ;)
« Last Edit: 2016-07-25, 16:51:23 by dubcat »
             ___
    _] [__|OO|
   (____|___|     https://www.twitch.tv/dubca7 / https://soundcloud.com/dubca7 ( ͡° ͜ʖ ͡°) choo choo

2016-07-25, 12:40:03
Reply #7

Godzil

  • Active Users
  • **
  • Posts: 22
    • View Profile
    • ONE2 architekci
O wow man! This is THE thread! Thank you, that will clear things out for sure!
Do you propouse to use Quixel or Substance Painter in production? I mean i know this can be a great tool, but is it a MUST HAVE if I need to create realistic looking stuff?

P.S. Can you share the LUT file? :D
« Last Edit: 2016-07-25, 12:46:06 by Godzil »

2016-07-25, 12:56:30
Reply #8

dubcat

  • Active Users
  • **
  • Posts: 425
  • ฅ^•ﻌ•^ฅ meow
    • View Profile
Quote
do you propouse to turn off the fresnel (set it to 999) and create a custom one for the metals, but leave it turn on and set it to round 1,3 for other materials (like plastics)?
Since Corona doesn't have "Advanced IOR" yet, you have to disable the "Simple IOR" and use "Siger ComplexFresnel" or a Custom Falloff in Reflection, to simulate "Advanced IOR".
For plastic you just leave Reflection at 1, and adjust IOR to your liking between 1.3-1.6.

Here is a little list i threw together for another user on the forum, this is how I use IOR.
IOR 1.33 (2% Reflectivity) Rough stone, Leather, white walls, fabric, mud etc.
IOR 1.42 (3% Reflectivity) Some leather, Polished stone, Some plastic.
IOR 1.50 (4% Reflectivity) Plastic

Quote
Quixel in production
It depends on your workflow.
Do you box/planer map everything and don't care how your UV's look ? If that is your case, I would wait for Corona to add triplanar mapping.
Do you custom unwrap your stuff and fit everything inside UV space without overlaps, then Quixel Suite / Allegorithmic Substance Painter is a great choice to boost your quality.

I own both Quixel Suite and Substance Painter. I love the scanned materials in Quixel Suite, but I can't stand the wait time, every single thing you do has to be processed by Photoshop. And the 3d viewer is coded in Unity, and is therefore using Realtime technology.

Substance Painter does not have the wait time problems, and it has iRay offline renderer as 3d preview alternative. iRay in Painter is behaving 100% the same as Renderman.

I switch between both from time to time, but I tend to use Painter more.
I only use them for props though. Walls and stuff like that I do 100% in 3dsMax.
             ___
    _] [__|OO|
   (____|___|     https://www.twitch.tv/dubca7 / https://soundcloud.com/dubca7 ( ͡° ͜ʖ ͡°) choo choo

2016-07-25, 13:05:10
Reply #9

Godzil

  • Active Users
  • **
  • Posts: 22
    • View Profile
    • ONE2 architekci
Quote
do you propouse to turn off the fresnel (set it to 999) and create a custom one for the metals, but leave it turn on and set it to round 1,3 for other materials (like plastics)?
Since Corona doesn't have "Advanced IOR" yet, you have to disable the "Simple IOR" and use "Siger ComplexFresnel" or a Custom Falloff in Reflection, to simulate "Advanced IOR".
For plastic you just leave Reflection at 1, and adjust IOR to your liking between 1.3-1.6.

Hm let's see if I understood you correctly: you suggest to leave IOR "on" for every plastic but in your opinion metals have "advanced IOR" and I should custom the IOR?
Or maybe i can custom all material'sIOR, even plastic ones...?

2016-07-25, 13:14:26
Reply #10

dubcat

  • Active Users
  • **
  • Posts: 425
  • ฅ^•ﻌ•^ฅ meow
    • View Profile
This is how you create a dielectric / plastic
Reflection Level: 1
Reflection Color: White
IOR: 1.3-1.6



This is how you create a metal
Diffuse: Black
Reflection Level: 1
Relfection Color: Siger Complex
IOR: 999

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

2016-07-25, 13:20:27
Reply #11

Godzil

  • Active Users
  • **
  • Posts: 22
    • View Profile
    • ONE2 architekci
Thank you so much, now all is clear as a whistle!

I have another question for all you guys If I may:

What is your best www where we can find IOR for a specific material? I know there are tons of it around the net, but I'm wondering what's your solutions :)

2016-07-25, 13:26:07
Reply #12

dubcat

  • Active Users
  • **
  • Posts: 425
  • ฅ^•ﻌ•^ฅ meow
    • View Profile
No problem!

Metals + some dielectrics
http://refractiveindex.info

Everything else
Quixel Suite + my Reflectivity to IOR sheet
https://forum.corona-renderer.com/index.php/topic,11377.msg81776.html#msg81776
             ___
    _] [__|OO|
   (____|___|     https://www.twitch.tv/dubca7 / https://soundcloud.com/dubca7 ( ͡° ͜ʖ ͡°) choo choo

2016-07-25, 15:07:01
Reply #13

Godzil

  • Active Users
  • **
  • Posts: 22
    • View Profile
    • ONE2 architekci

2016-07-27, 19:59:24
Reply #14

avl

  • Active Users
  • **
  • Posts: 7
    • View Profile
My current method is:
1. I choose a reflective curve of a material I want to create.
2. I represent this curve in fallof map that is put in the reflective (fresnel is off).
3. I'm trying to eyeball correct setting for GGX (GTR tail fallof) but im not sure what i'm doing there, what to type in there.
I do not blend materials with different gloss. already since i heard that GGX can do this for me. But i'm still trying to re-create the propper fresnel. Is that method ok?

Unfortunately, this won't re-create the proper Fresnel, unless glossiness = 1.0 or so.
It's far from easy to explain why it's so, but I'll try.

The problem is that micro-facet models (including GGX one) use Fresnel a bit differently.
Fresnel equation/curve assumes a perfectly smooth material.
Micro-facet models assume there a lot of micro-facets, oriented differently, i.e. their normals differ from the surface normal, according to some distribution (e.g. GGX distribution).
And a micro-facet model integrates responses from the distribution of the micro-facets in some nontrivial way.
The main problem is the Fresnel effect is calculated using so-called half-vector (a vector in-between a light and a camera rays), not a surface normal vector.

So, it's sad to say, but one cannot re-create the proper Fresnel in many renderers for rough materials.
Basically, there is no way to access light rays directly in a typical path-tracing renderer node system.

Some renderers implement micro-facet models in a "separable" way, i.e. they completely ignore the Fresnel term during light integration and multiply by a "smooth" Fresnel term later (using normal vector). Which works okay for a glossy case, but results in a noticeable unnatural rim in a rough case (glossiness = 0 or so).
This cannot be easily solved with falloff maps and so, since a proper implementation will use a different Fresnel curve for different light rays, roughly speaking.

So, a typical solution is to adjust GGX parameters (possibly with some curve/map) or even mix two GGX materials in some way, so that it looks plausible.
And this is unlikely to change, since it's non-trivial to implement a flexible solution. Ideally, there should be a dielectric GGX implementation and a metal GGX implementation, and probably a separate tinted-metal GGX implementation :). With enough parameters to calculate proper Fresnel curves during light integration.

Hope my explanation will be helpful, but generally speaking it's a quite complicated matter (I've spent lot of time to figure out what is the problem with the crazy rim effect for rough materials)