Specular reflection vs diffuse reflection.

Use this forum for general user support and related questions.
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
CodeHD
Posts: 405
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

Re: Specular reflection vs diffuse reflection.

Post by CodeHD » Wed Nov 25, 2020 3:43 pm

daros wrote:
Mon Nov 23, 2020 9:08 am
What do you think or suggest?
Sorry, forgot to respond again... My follow-up on Disney was here.

That makes it a bit clearer what you're after, thanks. I'm looking at the updated Disney model now as you can see from the thread I linked. But it will probably a persistent question after that: Is there another shader model that would be worth integrating into LuxCore?

lighting_freak
Posts: 216
Joined: Thu Jan 18, 2018 6:02 pm

Re: Specular reflection vs diffuse reflection.

Post by lighting_freak » Wed Nov 25, 2020 5:17 pm

Hello all,
CodeHD wrote:
Wed Nov 25, 2020 3:43 pm
Is there another shader model that would be worth integrating into LuxCore?
Yes, there should be an open BRDF/BTDF/BSDF format, that allows users to define the light interaction precisly per incidence angle...

I mean something like a theta/phi look up table. Maybe we could use IES files (or basically the file format) to write intensity distribution for a free amount of incidence angles...
A smart interpolation between those angles on top and done ;-)

Best regards
OS - Windows 7 X64
CPU - Intel CORE i7
GPU1 - Variants of notebook card from nVidia
GPU2 - Variants of notebook onboard card from Intel
Lux - Latest possible relaease

User avatar
FarbigeWelt
Donor
Posts: 1006
Joined: Sun Jul 01, 2018 12:07 pm
Location: Switzerland
Contact:

Computer Graphic Rendering of Material Surfaces

Post by FarbigeWelt » Thu Nov 26, 2020 9:04 am

LuxCoreRender has implemented parts of PIXAR's (Disney ) principle BRDF render model only.
Actually, any complete implementation of a serious BRDF renderer should be capable of importing real physical measured data obtained in a dedicated optical instrument from material samples stored in databases (some are open and free to public use).

NIST - Project 'Computer Graphic Rendering of Material Surfaces' (ended in year 2001)
NIST is an agency of the U.S. Commerce Department's Technology Administration.
index
iBRDF, their (NIST) enhanced BRDF render model
iBRDF
Figure 17: Two automotive shells with 20 degree specular gloss of 10 and 60
Figure 17: Two automotive shells with 20 degree specular gloss of 10 and 60
Source of image: additional images
source code
Light and Word designing Creator - www.farbigewelt.ch - aka quantenkristall || #luxcorerender
Windows 10 Pro 64 || 2x16 Cores, AMD Ryzen 3950X @3.5GHz, 64 GB RAM, DDR4 @3.2 GHz
2x openCL, AMD Radeon RX 5700 XT, 8 GB VRAM || Gfp = SFFT Gflops

User avatar
FarbigeWelt
Donor
Posts: 1006
Joined: Sun Jul 01, 2018 12:07 pm
Location: Switzerland
Contact:

Modeling of Varying Iridescence

Post by FarbigeWelt » Thu Nov 26, 2020 9:37 am

Although, this is only partly topic, check the the Unity Blog frequently to get an idea how Unity Lab's engineer develop real time render models to achieve convincing real looking images (rendered at comfortable frame rates on latest graphic cards).

Example
Modeling of Varying Iridescence
Light and Word designing Creator - www.farbigewelt.ch - aka quantenkristall || #luxcorerender
Windows 10 Pro 64 || 2x16 Cores, AMD Ryzen 3950X @3.5GHz, 64 GB RAM, DDR4 @3.2 GHz
2x openCL, AMD Radeon RX 5700 XT, 8 GB VRAM || Gfp = SFFT Gflops

tokiop
Posts: 33
Joined: Fri Apr 13, 2018 8:11 pm

Re: Specular reflection vs diffuse reflection.

Post by tokiop » Thu Nov 26, 2020 6:02 pm

Hi Daros, your material-testing setup is great ! Happy to see you here, I remember your quality works from Maxwell days :)

The fringe looks like it could be IOR related. Not sure how it is taken in account by the various shaders. Mixing a Matte and Glossy material seems to provide better control over reflection falloff, even if the result is quite dark. Sorry for the bad quality/convergence renders, my system is limited 3d-wise :D
Clearcoat.jpg
[Edit:]

To try and get more light, here's a test with more bounces, and Diffuse shader's diffuse color with color value=1.2 (living dangerously :lol: ), not sure it is taken in account. Maxwell had an "additive" mix shader I think, that could be used to add a glossy layer without loosing light.
Clearcoat2.jpg

User avatar
B.Y.O.B.
Developer
Posts: 3916
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Specular reflection vs diffuse reflection.

Post by B.Y.O.B. » Thu Nov 26, 2020 7:24 pm

tokiop wrote:
Thu Nov 26, 2020 6:02 pm
To try and get more light, here's a test with more bounces, and Diffuse shader's diffuse color with color value=1.2 (living dangerously ), not sure it is taken in account.
Color values in the materials are clamped to (0, 1): https://github.com/LuxCoreRender/LuxCor ... te.cpp#L52

tokiop
Posts: 33
Joined: Fri Apr 13, 2018 8:11 pm

Re: Specular reflection vs diffuse reflection.

Post by tokiop » Thu Nov 26, 2020 8:29 pm

B.Y.O.B. wrote:
Thu Nov 26, 2020 7:24 pm
Color values in the materials are clamped to (0, 1)
thanks for the info and your work B.Y.O.B. !

daros
Posts: 50
Joined: Thu Dec 12, 2019 3:25 pm

Re: Specular reflection vs diffuse reflection.

Post by daros » Fri Nov 27, 2020 1:33 pm

Hi tokiop, thanks for your tests. The mixer test would be perfect if you would be allowed to use a fresnel function to blend the nodes. It cannot be a constant value (like it is in maxwell after version alpha) but a value which varies accordingly to the incidence angle.

To me the actual disney halo problem seems to be much simpler as it looks.
The specular disney shader, as i see it implemented in Lux, seems to me a simple reflection layer following a fresnel function on top of diffuse reflection.
The following tests are done in Lightwave which easily allows me to define a custom fresnel curve. No GI sorry!
fresenl.JPG

I started with diffuse only
no reflection.jpg

Then i added the fresnel reflection
Diffuse + fresnel reflection. Looks exactly like disney.
reflection.jpg
It is clear that there is an access of energy bouncing to the eye.
In reality, as closer we get to the tangent, less diffuse reflection reaches the eye because the specular reflection starts to rule and hides it. They cannot sum. The specular reflection, at tangent, hides the diffuse layer behind. For the same reason you cannot look through a glass if you look at it at very low incidence angle; reflection and trasparency are simply inversely proportional.


So i created an inverted fresnel curve and applied it to the diffuse
Diffuse - inverted fresnel
-diffuse.jpg

If now i add again the fresnel reflection i get someting which looks as smooth as the photographic samples.
reflection -diffuse.jpg

It would be really cool to at least try in Lux to subtract the inverted fresnel to the diffuse channel.

CodeHD
Posts: 405
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

Re: Specular reflection vs diffuse reflection.

Post by CodeHD » Fri Nov 27, 2020 2:52 pm

daros wrote:
Fri Nov 27, 2020 1:33 pm
To me the actual disney halo problem seems to be much simpler as it looks.
The specular disney shader, as i see it implemented in Lux, seems to me a simple reflection layer following a fresnel function on top of diffuse reflection.
There are two parts to this in the Disney shader:

1) There is indeed a fixed Fresnel-reflection layer (using the Schlick approximation). You can see the corresponding line of code here, together with the line below it. FH is the Fresnel factor ( =1 at the edge), and the line below is a linear interpolation ("Lerp"), which fades to white ("Spectrum(1.0f)") when FH = 1.
The effect can be visualised when you set metallic=1, roughness=0 and the material color to complete black. The result is the bottom image in this post.

1.5) As Dade has pointed out before, Disney always has a glossy (=metallic) component and is never 100% diffuse, keep that in mind.

2) The diffuse component has a blended behaviour with roughness: at roughness=0, there is a Fresnel-falloff towards the edges, reaching a factor of 0.5 at the edge. At roughness=1, it "models" grazing retro-reflection, so the intensity is amplified by a factor 2.5.

The reason why you are not seeing the falloff at roughness=0 is because of the blend with the metallic component.

Regarding energy conservation: Indeed, the Disney BRDF is not strictly energy conserving at all values and when the material color is perfect white, specifically caused by this diffuse retroreflection model at high roughness. Quote from Burley (2015):
While the Disney BRDF is not strictly energy conserving, for reasons discussed in Section 5.1, the
parameters are defined in such a way as to produce plausible results that are energy conserving given
plausible albedos which are typically much less than one.
In other words, it was deemed acceptable because realistic color settings are never full white.

tokiop
Posts: 33
Joined: Fri Apr 13, 2018 8:11 pm

Re: Specular reflection vs diffuse reflection.

Post by tokiop » Fri Nov 27, 2020 3:40 pm

daros wrote:
Fri Nov 27, 2020 1:33 pm
The mixer test would be perfect if you would be allowed to use a fresnel function to blend the nodes. It cannot be a constant value (like it is in maxwell after version alpha) but a value which varies accordingly to the incidence angle.
It is pure non technical speculation, but as I understand :
  • IOR controls the fresnel faloff
  • mix shader normalizes reflected light between the two shaders
If this is true and I understand what you are explaining, playing with IOR and mix factor acts as a fresnel blend.

Here is a test with different IOR values for a glossy with black diffuse to see better the effect :

ClearcoatIOR.jpg

Higher the IOR and "flatter" are the reflections. However looking up for IOR references, IORs above 3 seem pretty rare, so it might not be physically sound to use it like this.

Post Reply