CesiumGS / obj2gltf

Convert OBJ assets to glTF
Apache License 2.0
1.7k stars 305 forks source link

About the stereoscopic problem #175

Closed simonasdmd closed 4 years ago

simonasdmd commented 5 years ago

I use the same obj file. Exported two copies of gltf. Found that obj2gltf has a bad stereoscopic effect. Is there any way to solve this problem? obj2gltf: 73b81n29b1_nz 6ze9wtgwv others: 6 pzl 9 1wzk 22m9 n713

lilleyse commented 5 years ago

One reason might be that obj2gltf doesn't generate normals if they are missing. From the first screenshot it looks like there aren't any. Another reason might be that obj2gltf sets each material's doubleSided to false which might be culling back-facing triangles.

Are you able to share your obj?

simonasdmd commented 5 years ago

The data is here. I hope to solve this problem. I am willing to cooperate if I need help. Hard work for you. (PS:Because of size limitations. I compressed it twice with 7z and zip.) TARGET1_2.zip

simonasdmd commented 5 years ago

hi~ Is there any idea about this issue now?

lilleyse commented 5 years ago

@simonasdmd this is what I see when loading the model in gltf-viewer. It looks correct to me.

model

I think the problem is that CesiumJS doesn't automatically generate normals yet (see #6506) and obj2gltf doesn't have a stage for generating them either. Until then you might need to use some other tool to generate normals on the obj. One way that usually works for me is to load the obj in Blender and then export a new obj.

simonasdmd commented 5 years ago

Can you do this in the conversion process? Because I am calling obj2gltf with a script. There are thousands of obj files, and it is very difficult to use Blender.