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

Converting Metallic Roughness and Albedo to traditional DiffSpecNorm? #2330

Open
VinnyVicious opened this issue Sep 20, 2023 · 6 comments
Open

Comments

@VinnyVicious
Copy link

I'm working on loading gltf models on an older engine that does not support PBR rendering, and I've been struggling on how to use the following texture maps:

https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/DamagedHelmet/glTF

I undestand that Diffuse could be the result of Albedo + AO with a "burn" blend mode, but what about metalRoughness? How can that be used as a traditional grayscale specular map?

@javagl
Copy link
Contributor

javagl commented Sep 20, 2023

There is an appendix in an (archived!) extension that might be helpful. It points to some utility functions that are supposed to do this conversion. (I won't be able to help any further, but maybe the implementors or PBR experts will chime in here).

@bghgary
Copy link
Contributor

bghgary commented Sep 20, 2023

I don't know what DiffSpecNorm means, but the appendix that @javagl pointed to is for a different PBR model with specular/glossiness maps. Since you say this older engine doesn't support PBR rendering, it will likely not translate well. That said, if you translate baseColor/metallic+roughness into diffuse/specular+glossiness as written in the code from the appendix, it will at least be closer to a traditional model (e.g., BlinnPhong).

Here is a live version of the appendix for Babylon.js: https://bghgary.github.io/glTF/convert-between-workflows-bjs/

@VinnyVicious
Copy link
Author

Sorry for the lack of detail. By DiffSpecNormal, I mean the traditional old-gen workflow, popular in UDK, Unreal Engine 2, Unity 2, id Tech 4 and others:

image

@bghgary
Copy link
Contributor

bghgary commented Sep 21, 2023

Sorry, without documentation on what lighting model this uses, I don't know if it's clearer :-/

@VinnyVicious
Copy link
Author

@echadwick-artist
Copy link
Contributor

This article might be helpful. https://marmoset.co/posts/pbr-texture-conversion/#metaltospec

However as bhgary indicated, pre-PBR lighting models are likely not easy to convert to.

As I recall there was often an avoidance of performing lighting calculations in linear color space, which led artists to overcompensate with blue specular textures, to achieve neutral specular response on skin tones.

There was also no standardization for lighting values, leading to ad-hoc texture values based on specific lighting conditions.

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

No branches or pull requests

4 participants