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

3D model turn black after conversion into gltf/glb #134

Open
fzlavr opened this issue Mar 14, 2018 · 5 comments
Open

3D model turn black after conversion into gltf/glb #134

fzlavr opened this issue Mar 14, 2018 · 5 comments

Comments

@fzlavr
Copy link

fzlavr commented Mar 14, 2018

Hi, i have a problem in conversion into gltf and glb.
i have put all the material (.obj , .mtl , .jpg) into one folder then i convert it with basic command like this obj2gltf -i model.obj -o model.gltf
But, the result is like this https://imgur.com/oH5nueG
all side of the object turn into black and seems like the texture and color are not convert well..
is there anything that i miss when converting ?

FYI, this is my files which i want to convert..
https://imgur.com/9zzlG4g

@fzlavr
Copy link
Author

fzlavr commented Mar 14, 2018

it solved..
my model has the texture and its color..
i should put --materialsCommon after the model name of gltf. So, it should be like this
obj2gltf -i model.obj -o model.gltf --materialsCommon

@lilleyse
Copy link
Contributor

Good that you solved it. Eventually we will add support for unlit materials #130, so in the future you might be using --unlit instead of --materialsCommon.

@CrashedBboy
Copy link

Hi @fzlavr and @lilleyse ,

I've checked the option --materialsCommon's description out:

The glTF will be saved with the KHR_materials_common extension.

Why the missing of texture is related to this option?
So, every model with texture should be converted with this option in order to keep the texture?

@lilleyse
Copy link
Contributor

The --materialsCommon option isn't required. The main issue was a Cesium bug where models without normals would get rendered as black. That was recently fixed in CesiumGS/cesium#6501.

So try without --materialsCommon and load the model in Cesium master, it should render correctly now.

@miguelfernandesidesign
Copy link

Hello, I'm facing the same problem.
Which program are using to convert?

Thank you

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

4 participants