Currently, in the obj2gltf repo, a gltf output file will have the doubleSided property of its material tag set to true or false depending of the d or Tr parameters found in the mtl file of the obj model.
This is problematic because there are some obj models that have an alpha value of 1.0 but where not all faces of the model have been properly scanned.
One scenario that I am investigating right now is where a person did a 3D scan of a bridge by standing at the foot of the bridge and generated an obj file. The obj model renders fine but when converted to gltf, the top of the bridge is transparent because:
that part of the bridge was never scanned
at the top of the bridge, the normals are all facing downwards
the model has an alpha value of 1.0
I have tested the model by setting the d value in the mtl file to 0.99. Things are marginally better but then when the model is rotated, at any given time, all faces of the model are visible even when they're not supposed to. (Eg. the foot of the bridge is visible when it's not supposed to while the camera is placed at a birds' eye view)
I would like to suggest adding an extra parameter named --doubleSidedMaterial to the list of command line arguments to toggle the material doubleSided property of the resulting gltf file. By default, this parameter will be false thus preserving the current behaviour of the converter.
Currently, in the
obj2gltf
repo, agltf
output file will have thedoubleSided
property of itsmaterial
tag set totrue
orfalse
depending of the d or Tr parameters found in themtl
file of theobj
model.This is problematic because there are some
obj
models that have analpha
value of1.0
but where not all faces of the model have been properly scanned.One scenario that I am investigating right now is where a person did a 3D scan of a bridge by standing at the foot of the bridge and generated an
obj
file. Theobj
model renders fine but when converted togltf
, the top of the bridge is transparent because:I have tested the model by setting the
d
value in themtl
file to0.99
. Things are marginally better but then when the model is rotated, at any given time, all faces of the model are visible even when they're not supposed to. (Eg. the foot of the bridge is visible when it's not supposed to while the camera is placed at a birds' eye view)I would like to suggest adding an extra parameter named
--doubleSidedMaterial
to the list of command line arguments to toggle the materialdoubleSided
property of the resultinggltf
file. By default, this parameter will be false thus preserving the current behaviour of the converter.Please give me your thoughts.