Jump to content

Microsurface PBR


Rodrix3
 Share

Recommended Posts

Hi guys!

I am using PBR and testing microsurface property and I don't see any changes.

 

When does microsurface produce visible changes? Does the object need to be metallic or non metallic? Does the object need to have close to 0 roughness or close to 1?

Do I need to set any flag on to make this property work?

 

Thanks so much :)

Link to comment
Share on other sites

Hello,

microsurface works only if you are using the specular/glossiness workflow (meaning metallic, roughness settings are left null).

This controls how blurry the reflection appears meaning exactly like roughness would do on metallic/roughness workflow.

The value is 1 - roughness . So yes it is basically just a different convention to describe your material.

You will definitely see the impact more if your material is close to a mirror meaning the reflectivityColor being close to white.

This might actually help a lot: https://doc.babylonjs.com/how_to/physically_based_rendering_master

 

 

Link to comment
Share on other sites

1 minute ago, Sebavan said:

Hello,

microsurface works only if you are using the specular/glossiness workflow (meaning metallic, roughness settings are left null).

This controls how blurry the reflection appears meaning exactly like roughness would do on metallic/roughness workflow.

The value is 1 - roughness . So yes it is basically just a different convention to describe your material.

You will definitely see the impact more if your material is close to a mirror meaning the reflectivityColor being close to white.

This might actually help a lot: https://doc.babylonjs.com/how_to/physically_based_rendering_master

 

 

Ah!!! Thanks for the answer @Sebavan.

I am using gltf files, which by default uses the metallic workflow (I think).
Or at least, I can tell you that I am exporting via 3ds Studio Max and all my materials have a metallic texture and roughness defined.

 I guess that's why I wasn't seeing a difference!

Is microsurface a synonym for roughness and I will get exactly the same result if I used the metallic workflow;
or do you actually recommend using the specular/glossiness workflow for non-metal materials?
(If so which? Materials like ceramic with strong reflections, or would fabric materials fit in well, too?).

Also, I am now confused..thinking again, gltf files internally use metallic workflow, but when imported to Babylon, a PhysicalMaterial is used? (correct?).
And the Physical material contains both the specular/glosiness and the metallic workflow.

If this is true, how do I activate the specular/glosiness workflow?
Should I literally set material.roughness= NULL and material.metallicTexture = NULL?

Thanks so much  :)

Link to comment
Share on other sites

Is microsurface a synonym for roughness and I will get exactly the same result if I used the metallic workflow;

Micorsurface is a synonym of glossiness in Babylon and is equal to 1 - roughness.

or do you actually recommend using the specular/glossiness workflow for non-metal materials?

I really only depends of your preferences here and in your case, play with roughness instead of microsurface ?

(If so which? Materials like ceramic with strong reflections, or would fabric materials fit in well, too?).

They all fit in both workflow, it is more a matter of artist choices knowing use spec gloss could lead to not physically possible materials.

Also, I am now confused..thinking again, gltf files internally use metallic workflow, but when imported to Babylon, a PhysicalMaterial is used? (correct?).

As GLTF needs a lot of functionnalities they fit more with the full PBR which can switch from MetalRough to SpecGloss.

And the Physical material contains both the specular/glosiness and the metallic workflow.

It contains both to simplify our abstraction of the uber shader we have for PBR. It is also why we created 2 smaller mats to simplify development.

If this is true, how do I activate the specular/glosiness workflow?

To reactivate spec gloss you need to put null in all those properties:

  • metallic
  • roughness
  • metallicTexture

as stated in the documentation: https://doc.babylonjs.com/how_to/physically_based_rendering_master#from-metallicroughness-to-pbrmaterial

or easier recreate a new material

Should I literally set material.roughness= NULL and material.metallicTexture = NULL?

yup

Link to comment
Share on other sites

Thanks @Sebavan! This was all very helpful :)

>>They all fit in both workflow, it is more a matter of artist choices knowing use spec gloss could lead to not physically possible materials.

Just to clarify, choosing metal/rough or spec/gloss is an artistic choice, since both give DIFFERENT render results, right?
They are NOT just different naming conventions, they are in fact different shaders that produce different render results, correct?

 

Thanks again!
 

Link to comment
Share on other sites

Actually, most of the shader is the same, metal rough will be converted to spec gloss at the begining of the shader using:

microsurface = 1 - roughness;

// Default specular reflectance at normal incidence.
// 4% corresponds to index of refraction (IOR) of 1.50, approximately equal to glass.
const vec3 DefaultSpecularReflectanceDielectric = vec3(0.04, 0.04, 0.04);
 
// Compute the converted diffuse.
surfaceAlbedo = mix(baseColor.rgb * (1.0 - DefaultSpecularReflectanceDielectric.r), vec3(0., 0., 0.), metallic);
 
// Compute the converted reflectivity.
surfaceReflectivityColor = mix(DefaultSpecularReflectanceDielectric, baseColor, metallicRoughness.r);
 
then everything works in specgloss mode :-)
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...