Jump to content

From MetallicRoughness To PBRMaterial


javalang
 Share

Recommended Posts

@Deltakosh

Hello,

sorry for the trouble, I red the Doku "Master the Physically Based Rendering" again and again, but I can't figure out the flags "FromMetallicRoughness to PBRMaterial":

First of all I think there is something semantically wrong, maybe a typus?:

Quote

useAmbientOcclusionFromMetallicTextureRed: the metallic texture contains the ambient occlusion information in its alpha channel.

Besides this, there are some other points unclear, I also analyzed the sourcecode, but without having success.

Ok, starting easy with Roughness: can be either in Alpha or Green in the MT, so far so clear. But what happens on 1) ? Suggestion: only one flag: "useRoughnessFromGreenInsteadFromAlpha" ?

Regarding the statement below, does this mean if  UMFMTB==false the Red channel is used for Metallness? If this is the case then 7) is conflicting or there must be another statement: if UAOFMTR==true then metallness must be in BLUE ???

Quote

useMetallnessFromMetallicTextureBlue: the metallic texture contains the metallic information in its blue channel (it is considered in the red channel by default).

And at least, I cannot figure out the meaning of "UseAmbientInGrayscale" ==true (9). It seems to be a redundant flag?

Perhaps it would be good to know about the priority how these flags are processed, maybe this gives a bit light in my darkness :)

Anyway, I put my insights into a truth table,

thanks in advance.

 

image.png.78c55abeb742656f73a57b8fc437b07d.png

PS: Maybe a much better way to give a clear overview is to define three selectors: a RoughnessSelector, MetallinessSelector and AOSelector. Each of these selectors can then be assigned with a number representing the channel of the Metallic/Ambient Texture.

 

Link to comment
Share on other sites

Regarding "From Specular Glossiness to PBR Material" I have also some questions:

I've found out that the ambient color has no effect on the PBR MAterial. Is this a bug or a feature?

Reading the two statements below, how can the AO value retrieved from the metallic texture when this texture is null or undefined? Is this flag obsolete?

Any help is welcome,

thank you

 

 

Quote

The following properties need to be null or undefined:

  • metallic
  • roughness
  • metallicTexture
Quote

useAmbientInGrayScale: the ambient occlusion is forced to read only from the red red channel of the ambient texture or from the red channel of the metallic texture.

 

Link to comment
Share on other sites

Hello,

useAmbientOcclusionFromMetallicTextureRed means the ambient is used from the red channel of the metallic texture (I have just fixed the doc).

useRoughnessFromGreenInsteadFromAlpha is a nice idea. I kept both flag for back compat purpose but I agree it could be one boolean. If both useRoughnessFromMetallicTextureAlpha and useRoughnessFromMetallicTextureGreen are false, the roughness will be only retrieved from the scalar value which is a nice setup if you want to rely on a separate microSurfaceTexture.

useMetallnessFromMetallicTextureBlue this forces to use the blue channel instead of red for the metalness. This can conflict with useAmbientOcclusionFromMetallicTextureRed if not carefully setup as both ambient and metal would be taken from the same channel.

UseAmbientInGrayscale helps switching from using the luminance of the occlusion texture instead of the red channel only. Depending on the tools you are using to create your AO texture this might help. If useAmbientOcclusionFromMetallicTextureRed has been set, you will only use the red channel anyway.

I do agree this is lot of options and this was the main purpose for us to create the two new simpler versions: PBRMetallicRoughnessMaterial and PBRSpecularGlossinessMaterial. Those have a limited set of features available ensuring the reduced confusion.

Regarding the selector, it is a really cool idea, feel free to submit a PR for it, I would happily integrate it in.

 

 

 

Link to comment
Share on other sites

@Sebavan thanks Sebavan, I didn't know that there first was the PBRMaterial and after then the specialized versions were created, I thought it was the opposite way. I understand the problem with the backward compatibility , anyway it is a bit clearer for me now, I will try to integrate these parameters to my fresh PBR Composer.

But there is another question just now: once started with the Glossy setup (with metallic, roughness and metallicTexture =null), then changed to the Metallic setup everything works fine, but I cannot switch back to the Glossy setup (with setting metallic, roughness and metallicTexture again to null). Is there a special function to bring the material back to initial state?

 

Link to comment
Share on other sites

  • 3 years later...

Hi,

Not sure if this is related or not but when setting the various values of a pbr material  on a loaded glb file I cannot set the metalic value successfully.

Roughness and albedo seem fine but when I set the metalic value in code it does not change. If I then view the scene the value in the debugger the metalic vale is 0 and not as I had set it in the code but if i move the metalic slider tiohas the desired effect but setting it in code doesn't seem to and its limited only to the metalic value of PBR material. This seems to be the case only when I load a glb model and then try and set the metalic value on the already assigned pbrMaterial.

Thanks in advance,

Kev

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...