Author Topic: Roughness implementation correct?  (Read 2498 times)

2023-08-10, 13:45:08

philipbonum

  • Active Users
  • **
  • Posts: 73
    • View Profile
Hi there

I've recently converted my material library to the new PhysicalMtl and noticed an effect I hadn't really thought about before:
When a material has a high roughness value it makes the material appear darker when looking at it towards the sun, and brighter when you have the sun at your back.

To recreate:
It seems to be an effect that starts at around 0,5 roughness, and easiest to see when using a cube/plane and a simple corona sun and sky setup. Look at the cube at gracing angles in RT and rotate between having the sun at your back or when looking towards the sun. As you increase the roughness value the materials noticeably darkens when you rotate to look towards the sun.

Is this physically correct?

I've just never seen this effect in real life, and so I started digging online

--Commence rambling--

Is it because the material BRDF(?) tries to emulate a masking and shadowing of microfacets?

This led me to try and check the energy preservation of the material by using what I've learned is called a "white furnace" that is a "a uniform lighting environment set to pure white, to validate the energy preservation property of a BRDF. When energy preservation is achieved, a purely reflective metallic surface (f0=1) should be indistinguishable from the background, no matter the roughness of said surface."

Increasing the roughness of a white(255) material in a white(255) environment is clearly showing a darkening at gracing angles with the PhysicalMtl, but not on the LegacyMtl

If I'm understanding things correctly this is mainly because these different BRDF's(?) all try and emulate a proper physical reaction to light and all fail in different ways. None of these BRDF's are perfect.

This might be entirely unrelated and is a bit out of my area of expertise so excuse my ignorance on the subject.

--Rambling over--

Anyway, if this darkening is indeed wrong, I would like to know how to deal with it.
Maybe one should try and keep roughness below 0,5 or even use the legacy material for very rough surfaces? I noticed the legacy material staying completely invisible in the "white furnace", but it probably has other issues, I'm sure I've read some old complaints about it.

If on the other hand this effect is physically accurate, what materials can have this effect? I would be interested in fine tuning my materials even further and would like to check this out in real life.

2023-08-10, 14:22:03
Reply #1

pokoy

  • Active Users
  • **
  • Posts: 1925
    • View Profile
Yes, this is a generalization of highly rough surfaces and is considered correct, a similar effect can be seen across many different renderers with modern BRDF models - it tries to account for tiny irregularities in the surface that can't be sufficiently modeled with bump/displacement.

A classic example is the moon - it's (roughly) a ball but appears flat due to its highly rough surface as opposed to a shiny object where the shading changes more gradually.

I remember a nice thread or post explaining this on here and elsewhere (back when it was introduced in Arnold and Corona users asked for it) but can't find it unfortunately.

EDIT - here's a page showing the reasoning behind it: https://www.rombo.tools/2021/12/15/lambert-sphere/, albeit on a different shading model.
« Last Edit: 2023-08-10, 14:25:51 by pokoy »

2023-08-10, 14:58:19
Reply #2

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 13154
  • Marcin
    • View Profile
When a material has a high roughness value it makes the material appear darker when looking at it towards the sun, and brighter when you have the sun at your back.

To recreate:
It seems to be an effect that starts at around 0,5 roughness, and easiest to see when using a cube/plane and a simple corona sun and sky setup. Look at the cube at gracing angles in RT and rotate between having the sun at your back or when looking towards the sun. As you increase the roughness value the materials noticeably darkens when you rotate to look towards the sun.

Could you post some image examples of this? I don't understand the "sun at your back / looking towards the sun" part. Do you just mean having the camera perpendicular to the surface vs grazing angle?
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2023-08-10, 15:16:10
Reply #3

philipbonum

  • Active Users
  • **
  • Posts: 73
    • View Profile
Hmm, interesting, too bad I can't really go to the moon to check it out, eh? :)
But I should probably find a really dusty surface and check that!

Thanks for the information

Anyway, in your article it says that "The main offender on the Oren-Nayar implementation (rombo DiffuseGeneralized, Arnold Std Material) is that it is based on single scattering and so it leaks energy (diffuse gets too dark with increasing roughness). "

Isn't this what the CoronaPhysicalMtl uses?

So in other words, it's not correct?
This is in line with the "white furnace" test I did
Ideally the material should be invisible when rendered in this environment no matter the roughness level

@Maru, sure see attached images. Look at the top face of the cube and the way it darkens a lot in "CamBehind" compared to the "CamFront" picture when Roughness is 1. This is obviously opposite of what happens with reflective surfaces, hence my surprise. (Exposure stays the same between images)

2023-08-10, 15:40:30
Reply #4

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 13154
  • Marcin
    • View Profile
Thanks, I get it now. So it looks like with high roughness it reflects more light back in the direction of the light source than into the camera. It's something like retroreflection, or the negative directionality values in Corona Volume Mtl.
Yes, we are using the Oren-Nayar BRDF in the Corona Physical Mtl - https://support.chaos.com/hc/en-us/articles/4526293874577-Corona-Physical-Material-3ds-Max

Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2023-08-10, 15:46:35
Reply #5

pokoy

  • Active Users
  • **
  • Posts: 1925
    • View Profile
Here's a paper on a shading model of the moon:
https://serwiss.bib.hs-hannover.de/frontdoor/deliver/index/docId/2105/file/Bachelorarbeit_Alexander_Kuzminykh_20210818.pdf

The link I posted above is about Lambert, a really old shading model from +20 years ago.

The one used in Corona is GGX as far as I know, which is considered the PBR standard nowadays.
It is energy-preserving - the darkening is just happening in (your) viewing direction, whereas the BRDF directs more reflected light in the opposite direction (light source). Similar to the phase function in volume rendering. The amount of energy is the same, it's just 'balanced' differently between viewing direction and light source.

Do a search on 'microfacet BRDF', 'GGX BRDF roughness' or similar terms, you might find something for further investigation.

Here's a link from a chaos forums thread (from 2019, so a bit outdated and I haven't read through it), I guess there might be more on this topic over there:
https://forums.chaos.com/forum/chaos-common/chaos-common-render-theory/1023211-shading-improvement-thoughts

EDIT - just reading Maru's post about Oren-Nayar being the model used by Corona.... well, my knowledge on the matter is close to zero anyway, maybe someone else with more expertise will join here and shed some light on the topic.

2023-08-14, 07:52:52
Reply #6

philipbonum

  • Active Users
  • **
  • Posts: 73
    • View Profile
Thanks, I get it now. So it looks like with high roughness it reflects more light back in the direction of the light source than into the camera. It's something like retroreflection, or the negative directionality values in Corona Volume Mtl.

Yes, this is what it looks like to me too.

I can understand the thought behind a very rough surface showing me the "shadow side" and hence making the surface appear darker in this case.
But when checking with the white furnace, there seems to be some issues with the shading model. This makes me question how much darker it should be getting, if at all. Not really sure if this is a valid way of checking this, so if anyone has any notes please chime in :)

Checking online I do actually find more evidence that the Oren Nayar model has some energy loss at high roughness.

Anyway, that is the shading model we have, so now I'm just wondering if anyone else has had any issues with this. Should we be careful with a roughness value past a certain point, or am I over complicating things?
I guess it's only something you notice if you pull the camera back and forth between the sunny and the shadow side of an object, so maybe it's only a "problem" in animations?

2023-08-14, 09:22:55
Reply #7

BardhylM

  • Active Users
  • **
  • Posts: 56
    • View Profile
    • Behance
I happen to notice it sometimes, as where the same material in surfaces that are perpendicular or in general different directions, appears to have two different colors (in value).
Often clients tell me to make them the same material, and I just make two different materials to match each other and not bother explaining.
I took it as GI thing where other surfaces affect the geometry, but yes that is a thing I notice when creating flat color materials. Can't say if it is right or wrong, just wanted to share.

2023-08-14, 12:06:58
Reply #8

Juraj

  • Active Users
  • **
  • Posts: 4797
    • View Profile
    • studio website
Hm, that's interesting thing to check. I always considered this to be retro-reflection, which would be correct. But it can also be part energy loss.. which would be wrong.

Maybe testing against ChaosScans which should be fairly accurate representations of real-world materials could lead to some useful comparison.
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!

2024-04-17, 15:28:56
Reply #9

piotrus3333

  • Active Users
  • **
  • Posts: 267
    • View Profile
The thing I find different about CoronaPhysicalMtl and energy conservation is actually too much energy reflected at low Base Color values like 0.02-0.04.
Marcin Piotrowski
youtube

2024-04-18, 10:40:34
Reply #10

piotrus3333

  • Active Users
  • **
  • Posts: 267
    • View Profile
The thing I find different about CoronaPhysicalMtl and energy conservation is actually too much energy reflected at low Base Color values like 0.02-0.04.

I'm talking nonsense - CoronaPhysicalMtl is actually a bit darker than StandardSurface.

What is odd though is that CoronaPhysicalMtl returns at F0 (furnace test, GeoSphere mesh, Base Color 0.18, full roughness, ior 1.5) less than 0.18 float.

Compared with VRayMtl here:
Marcin Piotrowski
youtube