Open wallabyway opened 2 years ago
The metal issue is related to using the wrong materials json file.
The Materials.json.gz
file maps the f0 base color
into the specular
value, but the metallic-roughness
value is gone. The ProteinMaterials.json.gz
file contains both the f0 base color
of metals, as well as it's metallic roughness
.
The ProteinMaterials.json.gz
has more information needed for glTF's PBR materials, than Materials.json.gz
. You may want to switch over to that.
Note: fixing metals will also fix this issue... https://github.com/petrbroz/forge-convert-utils/issues/23
Looks like LGLTracer is missing support for KHR_texture_transform, causing the texture scale issue. Nothing to do with forge-convert-utils. https://github.com/LGL-Tracer-Renderer/LGL-Tracer-Renderer.github.io/issues/15
divide glossiness by 20 and by 60, depending on isMetal
, like so...
at line 126 in reader.ts
roughness: _mat?.glossiness ? ( 20.0/ _mat.glossiness ) : 1.0, // TODO: how to map glossiness to roughness properly?
scale: {x: _mat?.maps?.diffuse?.scale.texture_UScale ?? 1.0 , y: _mat?.maps?.diffuse?.scale.texture_VScale ?? 1.0}
};
if (_mat?.diffuse) {
mat.diffuse.x = _mat.diffuse[0];
mat.diffuse.y = _mat.diffuse[1];
mat.diffuse.z = _mat.diffuse[2];
}
if (_mat?.metal && _mat.specular && _mat.glossiness) {
mat.diffuse.x = _mat.specular[0];
mat.diffuse.y = _mat.specular[1];
mat.diffuse.z = _mat.specular[2];
mat.roughness = 60/_mat.glossiness;
}
Thanks @wallabyway, I've just merged the PR. Next week we can test it out and publish a new version if everything looks correct.
Markers:
Right: Fusion(F3D) in LMV Left: LGLTracer with glTF
Source F3D: https://developer.api.autodesk.com/oss/v2/signedresources/8982cad5-0eda-4beb-96fb-6244062d21aa?region=US