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

[suggestion] In obj2gltf, create a flag --doubleSidedMaterial to allow materials to be doubleSided regardless of transparency #293

Open
chetan-set opened this issue Oct 2, 2023 · 0 comments

Comments

@chetan-set
Copy link
Contributor

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:

  1. that part of the bridge was never scanned
  2. at the top of the bridge, the normals are all facing downwards
  3. 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.

Please give me your thoughts.

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

1 participant