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

2018-02-06, 13:08:34
Reply #150

Fluss

  • Active Users
  • **
  • Posts: 437
    • View Profile
Juraj, can you PM me ? I'd like to discuss some stuff with you if you don't mind

I'm a lurker here (without much to say) and I really appreciate you guys going at it - going at the problem that is. :) That said, the more public spamming you guys do the better - I really enjoy reading the findings you smart people come up with. Hurrah! Thank you!

Don't worry, will still sharing stuff here, just wanted to ask some hints to go further on the specular part without polluting the thread too much with trial and errors. Anyway, we're talking diffuse roughness, for now, let's see that later..

Here is another test to demonstrate the diffuse roughness contribution in Arnold. Diffuse shading is way smoother, diming light at F(0°) (which give the plastic look) and eliminating the black fringe Lambert tends to produce at grazing angles. Also, note that the whole thing appears to be darker, both tests were rendered in the same lighting and exposure condition. The shader is supposed to be energy conservative tho, that's just that diffuse rays are more scattered resulting in fewer rays hitting the camera hence darker render I guess.

edit: also grabbed a copy of the latest blender version which provides an implementation of the Disney uber shader. Will be interesting to see what it brings to the table :)
« Last Edit: 2018-02-06, 13:16:54 by Fluss »

2018-02-08, 15:45:00
Reply #151

Fluss

  • Active Users
  • **
  • Posts: 437
    • View Profile
Hey guys, I've made some more tests across different renderers to compare diffuse roughness at min/max values. Diffuse only, no specularity involved, here is what we get :











We can see that Fstorm and PxrDisney really stand out here, simply by the fact that they are modifying the shadow terminator according to the roughness (diffuse roughness for Fstorm, global roughness for PxrDisney). We can also notice that PxrDisney shader brighten up the diffuse at grazing angles, which Fstorm doesn't. Let's try to go a little bit more in depth.

It looks like there are two models that seem to be involved here :
_the diffuse model
_the geometric shadowing-masking model

For the diffuse model, PxrDisney uses a custom-made empirical brdf based on their observation of MERL100 samples.

Quote
This produces a diffuse Fresnel shadow that reduces the incident diffuse reflectance by 0.5 at grazing angles for smooth surfaces and increases the response by up to 2.5 for rough surfaces. This seems to provide a reasonable match to the MERL data and was also found to be artistically pleasing.

This is clearly noticeable on the PxrDisney test. As a contrary, Fstorm doesn't seems to do such computation and I now assume Lambertian model is used there.

The shadow terminator seems to be driven by the geometric shadowing-masking model which represent the shadowing from the microfacets (a.k.a specular G function). The BRDF viewer allows us to preview the different BRDFs independently, to better see the distinct contribution of each function in the shader. I used it to preview some specular G functions and made some screen of the Walter BRDF which is the one that seems to be the closest to what we get in Fstorm.

Min and max :





This function exposes an alphaG parameter which has a range of [0.001;1]. What's more, the PxrDisney has been implemented as follow :

Quote
we use the G derived for GGX by Walter but remap the roughness to reduce the extreme gain for shiny surfaces. Specifically, we linearly scale the original roughness from the [0, 1] range to a reduced range, [0.5, 1], for the purposes of computing G.

This correlates very well with what we get in Fstorm -> diffuse roughness range [0.5;0.99].

However, the implementation of this function seems to differ blithely between the Fstorm shader and Disney shader. In the Disney shader, everything is derived from the global roughness setting and is automatically performed backend. In Fstorm, the parameter is exposed and this seems to affect the diffuse component only.

In regards to the "more directional look" Juraj and Dubcat were talking about, I've also made some test on the specular part :

Corona :



Fstorm :



I guess it's because Fstorm uses Beckmann BRDF instead of GGX :

Beckman :





GGX :



« Last Edit: 2018-02-08, 15:50:20 by Fluss »

2018-02-08, 16:55:25
Reply #152

Fluss

  • Active Users
  • **
  • Posts: 437
    • View Profile
Oh and just for the sake of it, here is a real photograph. Better than thousand words....


2018-02-09, 02:26:00
Reply #153

dubcat

  • Active Users
  • **
  • Posts: 460
  • ฅ^•ﻌ•^ฅ meow
    • View Profile
damn, you guys have been going ham since my last visit. Big thank you to Fluss for all the testing, really appreciate it! That photo is my staple for render testing!
             ___
    _] [__|OO|
   (____|___|     https://www.twitch.tv/dubca7 / https://soundcloud.com/dubca7 ( ͡° ͜ʖ ͡°)

2018-02-09, 02:59:08
Reply #154

sebastian___

  • Active Users
  • **
  • Posts: 143
    • View Profile
Very interesting the real photograph, too bad it has light bouncing from bellow and it's a little harder to compare the lower area, because it's standing on a white plane.

2018-02-09, 03:49:57
Reply #155

worx

  • Active Users
  • **
  • Posts: 8
    • View Profile
Is there a way to replicate defuse roughness in corona? Because i also find corona being a little flat, and really have to use post to get that soft shading looking

2018-02-09, 09:00:15
Reply #156

nkilar

  • Active Users
  • **
  • Posts: 852
    • View Profile
    • My personal website
Great tests @Fluss ! :) I suppose I am late to the party when it comes to realizing that FStorm uses the Beckmann BRDF model. Huh. Thanks for the tests!

2018-02-10, 17:58:58
Reply #157

Fluss

  • Active Users
  • **
  • Posts: 437
    • View Profile
Very interesting the real photograph, too bad it has light bouncing from bellow and it's a little harder to compare the lower area, because it's standing on a white plane.

You are right. That and also the fact that the studio setup should produce way softer shadows than the HDRI used in the tests which should greatly influence the shadow terminator on the sphere. I'm gonna reproduce the setup to see how it behaves in Corona.

Anyway, after a lot of testing and observation, I think the diffuse roughness implemented in Fstorm is kind of weird. It shouldn't affect the diffuse that much, plus it does not affect what it is intended to. It gives a kind of coated material effect on every single shader created.

The PxrDisney shader affects both the diffuse at grazing angles and the shadow terminator, and it's much more subtle. BUT we lose control over the diffuse appearance as it's fully automated and there is no parameter exposed. It seems that they realized that since they have backtracked on that particular point. Indeed, the PxrDisney shader is already "outdated" and has been relegated to the legacy tab in the lastest Renderman version. It's still there but only for back-compatibility. They are now using the PxrSurface shader which is much more complex than the Disney one. The diffuse part is now pure Oren-Nayar. And I personally think it's the way to go.

In fact, I think CoronaMtl is not that far from the perfect shader, it just misses some features here and there.

To me, the perfect shader would probably be a carbon copy of the Alsurface shader + some features of the PxrSurface shader. This is what I'd go for :

_Better diffuse model (Oren-Nayar)

_An additional specular lobe. We will then be able to produce proper coated materials. WE NEED THAT. The CoronaLayeredMtl is.. well it's not a layered material, it's a blend material which is not the same. A proper layered material would allow us to stack multiple specular lobes in an energy conservative way, the top layers affecting the ones underneath.
At that point, with these only two features, the CoronaMtl would offer everything the Alsurface shader does. (minus the choice between Beckmann and GGX microfacets distribution).

I'd then add some nice features from the PxrSurface shader. Some of them are available following two modes, artistic/physical. I'd stick with the physical mode only :

_Layer thickness for the clearcoat: Everything is in the name, it simulates thickness for the additional specular lobe, really cool.

_Iridescence

_Fuziness: Full featured with gain, color, cone angle and bump. Not physically accurate but still nice to have

_Bump To Roughness: Insane feature! Basically,  it can use normal, displacement or even bump maps to affect microfacets distribution and anisotropy, in order to recreate surface imperfections in a way that is less prone to diverge according to the distance and produce more physically correct light interaction. (cf. paper below)

You can refer to the renderman documentation for more info on their surface shader: https://rmanwiki.pixar.com/display/REN/PxrSurface

And I strongly recommend you to read their recent paper on their material pipeline, really interesting: http://graphics.pixar.com/library/PxrMaterialsCourse2017/paper.pdf
« Last Edit: 2018-02-11, 17:06:48 by Fluss »

2018-02-14, 11:30:11
Reply #158

subpixelsk

  • Active Users
  • **
  • Posts: 456
    • View Profile
    • johny.mrazko.visualization
I was tired of the default material sphere that stretch materials all over the place. Here is a little guide on how to make a good looking material sphere.

Create a GeoSphere 50cm radius, since most scans nowadays are 1 meter.
128+ segments.
Type "Octa"



Throw a "Spherify" on there just to be safe



Add a "UVW Map" "Planer" mode



Default Sphere, nasty



Box turned in to a sphere



GeoSphere with Planar



Hey dubcat

this shader ball works only when viewing from the front right? other views would be distorted if I am applying it correctly

2018-02-17, 12:33:35
Reply #159

Juraj Talcik

  • Active Users
  • **
  • Posts: 3763
  • Tinkering away
    • View Profile
    • studio website
Great testing Fluss !!!

Sadly the issue isn't given much attention. It's all or nothing so currently it's volumetrics, and better shader and post-production will be 2020 I warrant a guess :- )
talcikdemovicova.com  Website and blog
be.net/jurajtalcik   Our studio Behance portfolio
Instagram   Our studio Instagram, managed by Veronika

2018-02-18, 15:54:41
Reply #160

Fluss

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

Hey dubcat

this shader ball works only when viewing from the front right? other views would be distorted if I am applying it correctly

You can try with a simple box, no segments, with UVs -> turbosmooth with multiple iterations -> spherify

Great testing Fluss !!!

Sadly the issue isn't given much attention. It's all or nothing so currently it's volumetrics, and better shader and post-production will be 2020 I warrant a guess :- )

Yes I guess it's not the priority ATM
« Last Edit: 2018-02-18, 16:36:24 by Fluss »

2018-02-20, 17:58:36
Reply #161

dubcat

  • Active Users
  • **
  • Posts: 460
  • ฅ^•ﻌ•^ฅ meow
    • View Profile
Hey dubcat

this shader ball works only when viewing from the front right? other views would be distorted if I am applying it correctly

Hey man! Yes, it's only for Corona Material Thumbnail preview or as a preview for your Material Library.

------------------------------------

I've been taking my Megascans scripts to the next level the past week.
Yesterday I wanted to solve the whole translucency issue. We have a front lit albedo scan and a back lit translucency map scan. There should be no reason why we need to adjust these maps for the material to behave properly. I've solved the issue, and this is how translucency is taken care of in my latest script.

In Corona we have Translucency "Fraction" and "Color.
When Fraction is 0 it's pure diffuse, the material is black when back lit. When Fraction is 1, it's pure Translucency Color when back lit.
Translucency Color gets multiplied by Translucency Fraction.
Currently the script is using 0.5 Fraction to get 50/50. Translucency map is multiplied by 2, since 0.5 * 2 = 1.







As a little side note.
We can't disable IOR with a Corona Color anymore. I noticed this when I was explaining complex IOR.
You can see here that the last 10 degrees are getting darker. 89 degree is 232 RGB.



edit: fixed a typo
« Last Edit: 2018-02-20, 19:58:22 by dubcat »
             ___
    _] [__|OO|
   (____|___|     https://www.twitch.tv/dubca7 / https://soundcloud.com/dubca7 ( ͡° ͜ʖ ͡°)

2018-02-20, 22:33:10
Reply #162

subpixelsk

  • Active Users
  • **
  • Posts: 456
    • View Profile
    • johny.mrazko.visualization
thanks for the reply

regarding megascans, if I would manually tweak the values without script to look correct it is rgb level 2.0 and translucency fraction 0.5 right?

2018-02-20, 23:26:10
Reply #163

oddvisionary

  • Active Users
  • **
  • Posts: 194
    • View Profile
    • Behance | Artstation : artstation.com/oddvisionary
I just found a LUT converter in the newest official Megascans Bridge version by the way. Might be a bit late in the discussion or you already know it...
Freelance Post-Prod / Lighting & Look Dev 3D Generalist | VFX Designer | Sound Effect Recordist & Sound Designer

Corona Discord server : https://discord.gg/2uxq8EA

2018-02-21, 00:32:09
Reply #164

dubcat

  • Active Users
  • **
  • Posts: 460
  • ฅ^•ﻌ•^ฅ meow
    • View Profile
regarding megascans, if I would manually tweak the values without script to look correct it is rgb level 2.0 and translucency fraction 0.5 right?
Yep :)

I just found a LUT converter in the newest official Megascans Bridge version by the way. Might be a bit late in the discussion or you already know it...

Hey!
That's my old LUT, it was hand made up to IOR 8 or something like that.
I've attached my latest version that was generated with code, it can remap any RGB value possible :)

edit:
Here is a test render using my improved IOR LUT.

« Last Edit: 2018-02-21, 01:34:41 by dubcat »
             ___
    _] [__|OO|
   (____|___|     https://www.twitch.tv/dubca7 / https://soundcloud.com/dubca7 ( ͡° ͜ʖ ͡°)