Open amichaelcody opened 4 years ago
Do you have a screenshot of the model from Fusion Team/A360 Web view (ala Forge Viewer) ?
@amichaelcody would you be able to share the original file with us? I'm guessing it could be some issue with mapping the original material's roughness to the glTF PBR material.
Ok, so here's what's happening: the material in the original design seems to be completely black (RGB: 0,0,0), with a relatively high roughness. Because of that, the model needs a very bright environment to be lit properly:
Try modifying the material in the glTF file, for example, changing the RGB to 0.2,0.2,0.2 and roughness to 0.01:
Looks like the prism metal value, is mapped outside the 0..1 roughness range. It needs normalizing?
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;
}