Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is DEBUG_METALLIC_ROUGHNESS used? #600

Open
andrewvarga opened this issue Feb 3, 2025 · 4 comments · May be fixed by KhronosGroup/glTF-Sample-Renderer#20
Open

Is DEBUG_METALLIC_ROUGHNESS used? #600

andrewvarga opened this issue Feb 3, 2025 · 4 comments · May be fixed by KhronosGroup/glTF-Sample-Renderer#20

Comments

@andrewvarga
Copy link

This option is listed in debugOutputMapping, but mr.METALLIC_ROUGHNESS is actually undefined.
There is also some code in pbr.frag referring to it but it doesn't do much:

    // If the MR debug output is selected, we have to enforce evaluation of the non-iridescence BRDF functions.
#if DEBUG == DEBUG_METALLIC_ROUGHNESS
#undef MATERIAL_IRIDESCENCE
#endif

Maybe it used to be there and got partially removed?
The option is not available to select on the UI (only metallic and roughness separately).
I would think either the option should be added to the UI + the shader code (if it's useful to visualize both metallic and roughness at the same time), or probably simpler to just remove it from everywhere.

@UX3D-haertl
Copy link
Contributor

Seems like we missed this after the shader refactoring last year which made this debug channel obsolete.
Thanks for pointing that out. I will remove the unused code.

@andrewvarga
Copy link
Author

Seems like we missed this after the shader refactoring last year which made this debug channel obsolete. Thanks for pointing that out. I will remove the unused code.

Great. Is it obsolete because now there is a separate metallic and roughness option?

@UX3D-haertl
Copy link
Contributor

There were only specular and diffuse values in the old simplified shader code. And the contributions of the different PBR features/extensions were added. Therefore, the contribution of metallic roughness could be shown easily.

Now we strictly follow the BRDF diagrams from the spec (and the modifications extensions apply to this diagram)

Image

Therefore, it does not really make sense to have a debug channel for the metallic roughness contribution, since it is also effected by other extensions.
With the new approach one can debug the different factors of the equations.
You can disable extensions, if you want to only see the metallic effect, but this could be misleading, since extensions do modify the formula.

@UX3D-haertl
Copy link
Contributor

E.g. the transmission extensions modifies the above diagram:

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants