Download

PBR - metallness, diffuse, specular... real confusion

Hello everyone, recently I tried out Unreal 4 shader in Mari, where I noticed weird stuff going on…

To avoid any more confusion, this is how I think real physics behave, please correct me if I am wrong.

Photons travel to surface of material, they either get into material, bounce in random directions and eventually fly of material in random direction (essentialy it is subsufrace scattering, with really low depth) this is what I call DIFFUSE/ALBEDO/COLOR OF MATERIAL or they bounce of material, either on same angle which is caused by low roughness or high glossines or they bounce in more random direction again by increasing rougness/reducing glossines (glossiness is inverted roughness right?)

factors that decide whether photon travels into material or bounces of material are:

  1. Reflectivity of material,

  2. Fresnel IOR of material

  3. Angle of photon path and surface

  4. Angle is set by geometry and light positions…
    But 1. reflectivity and 2. IOR is set independently in Vray for example…

however in Unreal engine there is only one parameter that changes both reflectivity and IOR (I guess) and it is called Metalness

This is my problem I encountered
http://www.imagehosting.cz/images/problemuep.png

in this example I wanted material 100% reflective like a chrome…

so I bumped metalness to max/white
then I set glossines to max/roughness to minimum
so all photons that get to surface should bounce off like mirror

however this did not happen… always…

when I set diffuse to white, it worked, however when I set diffuse to black, material got also black…

Why does this happen?
when all photon are supposed to bounce off, not get into material at all, why does diffuse affect material appearance at all?
If there are no photons supposed to get into material, but material doesnt reflect anything where do photons go? this breaks law of energy conservation…

At first I though this is MARI bug/bad shader but similar thing happened when I tested out metalness in marmoset 2 where I cant even achieve chrome material with metalness parameter…

Can anyone tell me what Metalness actually does? how does it control both reflectivity and IOR?

First theory is that unreal merged IOR and Reflectivity parameters them into one parameter to make it easy on artist and renderers like VRAY are better for having both parametrs

Second Theory is that Reflectivity parameter shouldnt even exist, and only thing we set to make material look reflective or not is actual IOR this parameter is called metalness in UE4

After I did some research, I noticed pixar/disney material has both specular (reflectivity I guess) and metalness, but on figure 16 you can see it has fresnel even on 0 specular value. https://disney-animation.s3.amazonaws.com/library/s2012_pbs_disney_brdf_notes_v2.pdf

or is it in reality even more complex?

Sorry for long complicated post, but I really want to solve this once for all thanks for all answers

I would need to double check but really quickly I think it’s because metallic is a quick way to avoid using a separate specular colour. In a PBR model with specular colour you use that to set the ‘metal’ colour but in UE4 and the metallic model, when metallic is 1 the specular colour is taken from the diffuse colour, in this case black therefore the reflection gets multiplied by black and ends up black.

If for example you wanted copper you would have a copper measured diffuse Albedo and Metallic at 1 would give you coppery tints to the reflections, this is correct in nearly all metallic surfaces and so a good way to gain performance, avoid an extra texture lookup, memory for an RGB texture that in the end would just be coppery etc.

I think you are over thinking things in referencing Disney (which is all interesting reading but it really doesn’t help). Read the above link, once you get it - it’s pretty easy.

thanks, I didnt know diffuse multiplies reflection value.

Now I know Mari works correctly, and where reflection parameter was hidden…
I had trouble understanding this because everyone taught me to make metals with really dark diffuse, but it doesnt apply in unreal 4 I guess…

So basically while texturing, you just paint objects white in metalness slot, and throw there approximately same diffuse color as you want metal brightness to be…

One more thing, what exactly is specular? because someone refers to it as white spot/highlights, someone refers to it as whole reflection I personally see it as reflections of light sources that are calculated independently from reflections of worlds, then composted together

Specular affects UE4 PBR very minimally, it does give a slider example at the bottom of the linked page but it’s not a great example because it’s a cube - I would recommend firing up UE4 and putting in some values to find out. Although it does control IOR as stated in the documentation unless really needed the 0.5 specular value is enough (and in my 300+ materials I’ve changed it once :P).

It may be that you have no indirect lighting so non-metals are unable to show reflections. Try adding an ambient cubemap or setting “environment color” to non-black in the world settings and try again.

There should not be that big of a difference between metal and non metal.

But one interesting tidbit… when making city backdrops a while back I found when making ‘realistic’ glass that the skyscrapers would not reflect the city brightly enough compared to photos etc. After a bit of research I realized that most commercial skyscrapers don’t just use glass, they have a bunch of specialized layers combined into a film to alter the properties of the window. A common layer is a thin metal layer that actually does act like a metallic reflection layer in ue4. It helps keep the buildings cooler in the sun. So I made the buildings metallic and didn’t worry about it too much after that :slight_smile:

Ghiest: I was referencing only one image no. 16 from that article, to show what parameters advanced shaders have
Ok, That specular term means probably something else in every software package…

RyanB: you are right, non metals with out ambient light or black diffuse should be black. However I had problem with 100% metal object together with environment, which should never give black when env is not black

Anadin: you told me exactly where was problem, UE4 optimizes, so when I have metal material, Diffuse actually tints metals by multiply math, and then obviously 100% metal * 0 diffuse gives me 0 reflection which is black.

Thanks guys I got this sorted out. I did watch some tutorials on creating materials, but no one did ever mentioned that multiplications, and how is overall reflectivity parameter control working