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

2018-03-22, 09:33:52
Reply #180

Fluss

  • Active Users
  • **
  • Posts: 442
    • View Profile
Looks great Dubcat! Some questions comes to my mind:

How can you extract specular values from a normal map?
I guess you basically linearly remap the "height" infos of the normal map, keeping the reflectance between the 2-5% range at F(0°), but that way, I can't understand how it can be better than a map derived from a reflection map which contains "proper" lighting pieces of information compared to a normal map.

Reflection and Specular maps are sRGB bitmaps (gamma 2.2) while normal maps and IOR maps are Linear (gamma 1.0), How is that handled?

Hey!
The IOR map is used in the "Fresnel IOR" slot and complements the glossiness map.

I a bit confused on the difference between IOR and Fresnel IOR inputs. Can you explain what properties are defined by each of those?

2018-03-22, 16:03:41
Reply #181

mferster

  • Active Users
  • **
  • Posts: 406
    • View Profile
@karnak

Yes, I am aware of how render elements work, thanks karnak. It looks like I misinterpreted what he wrote and got excited at the idea of simulated cross polarization filters.

2018-03-22, 17:16:56
Reply #182

karnak

  • Primary Certified Instructor
  • Active Users
  • ***
  • Posts: 66
    • View Profile
That was just my interpretation of what he wrote, and I hope I didn't accidentally offend you with it. :)
Corona Academy (May 2017)

2018-03-22, 18:18:15
Reply #183

mferster

  • Active Users
  • **
  • Posts: 406
    • View Profile
It's all good, I think you are quite right, that is indeed what he is doing.

But now it has lead me down a rabbit hole of experimentation to see if it is actually possible to simulate cross polarizing filters in Corona (or fake it atleast).
« Last Edit: 2018-03-22, 18:22:45 by mferster »

2018-03-22, 19:45:50
Reply #184

karnak

  • Primary Certified Instructor
  • Active Users
  • ***
  • Posts: 66
    • View Profile
Me too and I'm also excited about OSL in 3dsmax2019. A lot of stuff to experiment with! :D
Corona Academy (May 2017)

2018-03-23, 00:46:54
Reply #185

dubcat

  • Active Users
  • **
  • Posts: 460
  • ฅ^•ﻌ•^ฅ meow
    • View Profile
Wait, wait, wait!

Hey!
Create a "CShading_Components" pass and disable "Indirect". This should give you the same result as we get from cross polarizing and subtracting.
When we capture materials in real life, we use fast shutter speeds like 1/400+ to kill ambient light. We only want the direct flash/softbox light.

How can you extract specular values from a normal map?
I guess you basically linearly remap the "height" infos of the normal map, keeping the reflectance between the 2-5% range at F(0°), but that way, I can't understand how it can be better than a map derived from a reflection map which contains "proper" lighting pieces of information compared to a normal map.

Reflection and Specular maps are sRGB bitmaps (gamma 2.2) while normal maps and IOR maps are Linear (gamma 1.0), How is that handled?
Hey!
You are pretty much spot on.
In a perfect world we generate a 4+ point specular scan of a material, and run it through my generator. I only do Arch Viz and 80% of my texture library is still old school "non scanned".
By extracting height data from old school normal maps, we can at least fake depth somewhat. It's still better then not having any depth emulation at all.
And as a last resort, we can convert old reflection maps to IOR. This can be nice for wood materials, where we have to emulate the wood tubes that go in different directions. When we don't have a specular/normal map, and we don't want to use "Reflection Level" to clamp the Fresnel. "Reflection Level" is pure evil! (As a side note, pleeeeeeeeaaaase Ondra, can we get a Wood Material ?, http://www.cs.cornell.edu/~srm/publications/SG05-wood.pdf)

I a bit confused on the difference between IOR and Fresnel IOR inputs. Can you explain what properties are defined by each of those?
To be honest I have never done any research if the "Refraction IOR" behaves differently from "Diffuse IOR" in Corona, they should be the same. Most engines only have one IOR that control both diffuse and refraction.
« Last Edit: 2019-09-28, 03:34:30 by dubcat »
             ___
    _] [__|OO|
   (____|___|     https://www.twitch.tv/dubca7 / https://soundcloud.com/dubca7 ( ͡° ͜ʖ ͡°)

2018-03-28, 17:22:02
Reply #186

Basshunter

  • Active Users
  • **
  • Posts: 23
    • View Profile
Hi @dubcat. I recently discovered this thread and I must say everything that has been talked here is SO interesting! However, as a new Corona user I feel a little lost when trying to find the beginning and conclusion of the topics. Is there any way to easy access files, pictures or written conclusions resulting from the topics treated? Maybe another thread?
« Last Edit: 2018-03-29, 07:15:04 by Basshunter »

2018-03-31, 23:51:42
Reply #187

dubcat

  • Active Users
  • **
  • Posts: 460
  • ฅ^•ﻌ•^ฅ meow
    • View Profile
Hi @dubcat. I recently discovered this thread and I must say everything that has been talked here is SO interesting! However, as a new Corona user I feel a little lost when trying to find the beginning and conclusion of the topics. Is there any way to easy access files, pictures or written conclusions resulting from the topics treated? Maybe another thread?

Hey!

I will consolidate everything here http://dubcats-secret-little-hideout.wikia.com/wiki/Dubcats_secret_little_hideout_Wiki, it will take some time before the wiki gets refined and contain everything.
             ___
    _] [__|OO|
   (____|___|     https://www.twitch.tv/dubca7 / https://soundcloud.com/dubca7 ( ͡° ͜ʖ ͡°)

2018-04-11, 15:33:15
Reply #188

dubcat

  • Active Users
  • **
  • Posts: 460
  • ฅ^•ﻌ•^ฅ meow
    • View Profile
Paint manufacturers "fake" the brightness of darker colors on swatches. Luckily we can get measured "Light Reflectance Value" of the actual paint online.
The swatches also include IOR from what I understand.

Juraj sparked some ideas in my head yesterday, and last night I had a dream where I made a LUT that convert swatches to albedo.
The LUT will remove fake brightness and IOR from the swatches.
The more color samples I have, the more accurate the LUT will be.

I will share the LUT when it has at least 100 swatches, and then keep posting updates as I add more colors.

Here is an example of what it will do

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

2018-04-11, 18:15:12
Reply #189

peterguthrie

  • Active Users
  • **
  • Posts: 245
    • View Profile
    • Peter Guthrie Visualisation

2018-04-11, 18:33:14
Reply #190

mferster

  • Active Users
  • **
  • Posts: 406
    • View Profile
Dubcat's dreams are the best dreams. I wish my dreams were as productive.

*edit: So on a general bases what's the translatable value from a swatches Light Reflectance Value to a material's Albedo or IOR?
« Last Edit: 2018-04-11, 19:50:14 by mferster »

2018-04-11, 18:52:36
Reply #191

Dippndots

  • Active Users
  • **
  • Posts: 289
  • Alex Fagan Co-Founder at The Faction
    • View Profile
    • The Faction
Where did you get these swatches from originally dubcat? Color picking from manufactures' websites?

2018-04-11, 21:09:11
Reply #192

dubcat

  • Active Users
  • **
  • Posts: 460
  • ฅ^•ﻌ•^ฅ meow
    • View Profile
I love your dreams dubcat :)

hehe :)

So on a general bases what's the translatable value from a swatches Light Reflectance Value to a material's Albedo or IOR?

+

Where did you get these swatches from originally dubcat? Color picking from manufactures' websites?

Most painters in Norway use Jotun, so I sample my colors there.
They have a new 2018 set, that sparked the whole conversation with Juraj and Daniel R.
I can do a quick example. Lets use a dark color, since bright colors swatches are pretty accurate, we only need to remove 4% IOR from bright values.

Lets say someone want this dark brown NORWEGIAN WOOD 10981

You sample the manufacturers value



This color is #7f5c47

We go to e-paint and search for #7f5c47, because we don't know what the international standard name is.
The search result tell us that this color is part of "AMS Standard 595A -  Brown international"
And that the scanned LRV aka "Light Reflectance Value" is 13% Linear.

We can try to check the LRV of our current sampled value. But if we disable sRGB in "Corona Color Picker", we still get sRGB "Value" in Corona. I have made a requested that "Value" should be affected by the sRGB toggle, but I don't think it will happen. Maybe if enough people bug the devs about it, we can get this feature. It's really important.



Since "Corona Color Picker" "Value" is not linear, we have to do some side stepping.

Disable "sRGB", go to "0-100%", input 13.



Enable "sRGB" again and go back to "0-255".



Copy the Red value in this case 101.

Go back to our sampled color, and paste 101 into "Value"



We have now converted this preview swatch into real world LRV. But from my understanding this value still contain 4% reflectance from IOR 1.5.
But really, no one will notice this 4%. But I can't sleep well at night, knowing that I apply IOR 1.5 twice. And this is why you are one step ahead og the rest.

This is where I use pure white in "Environment Background", create a plane. Look straight down at the plane in orthographic. Use 1.5 IOR and 1 Glossiness (GGX glossiness will mess this up, if you use anything bellow 1). Then adjust "Value" until the sRGB match the original corona color value.

In our current case, this is what we get in IR with the corrected sampled color.



The brightest color is 113 sRGB. Because we have to deal with IOR.

But the brightest color in our sample is 101 sRGB, and these guys have to deal with IOR in real life too.

So we have to adjust our sample down to 87, 64 ,50.



Sometimes the darker colors change hue and saturation when you do drastic changed like this, you can manually correct this. But my LUT will take care of all this mess. The LUT is not generated in sRGB space.

TLDR; Just remember to give the devs a little PM that you want the sRGB toggle to affect "Value" in "Corona Color Picker", features like this depend on you!
« Last Edit: 2018-04-12, 17:00:05 by dubcat »
             ___
    _] [__|OO|
   (____|___|     https://www.twitch.tv/dubca7 / https://soundcloud.com/dubca7 ( ͡° ͜ʖ ͡°)

2018-05-22, 14:40:57
Reply #193

IsmaeL

  • Active Users
  • **
  • Posts: 47
    • View Profile
This is exactly the stuff I dream about XD

Just made a bathroom furniture catalogue and color is a major issue. The client uses NCS and we had to adjust everything in Post to match print and swatches. Just horribly painful.
So I'm glad to see I'm not the only one annoyed by the Corona Color Picker.

It would be so nice if we could get the Cinema Color Picker, it is very elaborate and useful.

Talking about color, maybe we could ask the devs to automatically load the screen color profile into the Corona Frame Buffer. Because right now calibrating my screen is not very useful in Corona.
Falling in love with Corona

2018-07-06, 02:53:11
Reply #194

dubcat

  • Active Users
  • **
  • Posts: 460
  • ฅ^•ﻌ•^ฅ meow
    • View Profile
I was having a chat earlier this year about HDRi and Corona Sun/Sky. Theres been lots of stuff happening in RL, so I haven't had much time to be active online (both forum and discord). I thought this stuff might be interesting for some people, so lets recap.

I made the switch from Vray to Corona back in 2015, and one of the first things I noticed was that everything felt "orange". I'm talking about VFB 6500K white balance.
I can't express how good it was to drop that damn green vray usb dongle that kept disconnecting every 10 min, sometimes mid render.

Earlier this year, people were going crazy on social media about HDRi, how good HDRi light was. They said stuff like, if you want smooth shadows, you must use a HDRi.

So earlier this year, I wanted to answer two questions. Why do I feel Corona is orange, and why do 90% of the world prefer HDRi skies.

I live in Scandinavia and I know that the strongest sun is at 12:00 6/21/2018. This gives us a latitude of 59.917.
The closest HDRi I could find online was Peter Guthries 1216 Sun Sky which is 58 degree.

Peter has been a good boy and updated his skies with a calibrated sun, but I wanted to keep the original camera sun values. So I will be using the original HDRi which he also provide.

Peters 1216 Sun sky is pretty much perfect, but as with any real world HDRi captures, there will be sun flare. We have to isolate the sun from the sky. And the sky has to be isolated from the sun flare.

We have to base our test on something, or else it would be random values. As usual I will be using 18% grey on my test subjects, this is 117 sRGB. Corona sun will be matching Peters HDRi angle, about 58 degree. Corona sky is a dynamic map, it will change color and gradient based on the sun position. We will change "Horizon blur" to 0 and Ground "color" to black, to match Peters HDRi.

The first thing we have to do is calibrate our "camera" aka VFB. We are using Corona Sun and Sky with default settings.
We know our test subject is 18% grey aka 117 sRGB. We have to lower EV in VFB to -5.24 for our test subject to meet 117 sRGB.
-5.24 EV will be our base for the rest of this test.



Our next step is to isolate the Sun from the HDRi, I will do this inside 3dsmax with this mask.



When we isolate the sun from the sky, this is what we get. Remember that this is the original camera capture. Peter provides a calibrated sun version when you purchase the HDRi. Most companies will only provide the "Photoshoped" perfect version, but Peter is keeping it real. If your monitor is not calibrated, it will show up as black.



If we boost the HDRi "RGB Level" to 520, we will match our calibrated Corona Sun value.




This calibration phase has to be done with any HDRi. It doesn't matter if its CG-Source, PG Skies or anyone else. No real world commercial camera can capture the real world sun value in a HDRi. Most people use the 0.8 gamma trick, this trick will boost your sun value a tad bit, and mess your sky values up like there is no tomorrow! The best way to handle real world HDRis, is to isolate the sun from the sky and calibrate them separately, because the values are so far apart.

I've been splitting sun/sky on a bunch of real world HDRis and on average the sky is "the sun RGB Level" / 100. In our case that is 520 / 100 RGB = 5.2 RGB.

I had to mask the sun flares on this render to calculate the values.



We have our Peter Sun/Sky split and calibrated. It's time to match Corona Sun/Sky to our real world captured data.
Lets start with the sun.

Our first goal is to match the "softness of the sun", 2.5 Corona sun size does the trick.
Our next goal is to match the RGB. When we switch to "Direct Input" aka 1.0 White Sun. 1 sun intensity does not give us 1 intensity in the render. So we have to boost the Sun intensity to 1.12 (Corona error?).
To match the sun RGB we have to change Red to 254 and Blue to 252.



This is what we get if we just isolate the sun from the HDRi and do not remove the lens flare. It's kind of crazy how much lens flare affect the render. Since lens flares have much lower value than the sun, it will help generate smoother shadows. So maybe I judged those social media people too soon.



If we remove the lens flares, we get this from the HDRi. You can see all the direct shadows from the lens flare is gone.
This is what we base our Corona Sky on.



To get a close match we have to use "Turbidity" 1.7 (1.7 does not satisfy the Peter capture, maybe 1.5 would, but we can't try)  and these values inside a "Color Correction". Color Correction is linear so 1 * 2 would result in 2.



This is how Peter Guthries 1216 Sun looks calibrated



With our quick approximated values, Corona Sun/Sky looks like this.



So in the end. Even small lens flares from real world captured skies will give you more "detailed" skies. Since you mix the sun with less valued light sources. If you capture a sky with clouds, the clouds will in most cases go above +1 RGB. Resulting in more soft light sources.
Most HDRis will have white balanced suns. But if you use Corona Sun "Realistic" it will give you an "Orange" look.
« Last Edit: 2018-07-06, 05:15:38 by dubcat »
             ___
    _] [__|OO|
   (____|___|     https://www.twitch.tv/dubca7 / https://soundcloud.com/dubca7 ( ͡° ͜ʖ ͡°)