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

GLB models from sketchfab imported with wrong materials #798

Open
4 of 7 tasks
KaminariOS opened this issue Nov 13, 2024 · 9 comments
Open
4 of 7 tasks

GLB models from sketchfab imported with wrong materials #798

KaminariOS opened this issue Nov 13, 2024 · 9 comments
Assignees
Labels

Comments

@KaminariOS
Copy link

Describe the bug 💬

Import GLTF models from sketchfab. I am using URP.

https://sketchfab.com/3d-models/lowpoly-generic-suv-police-259fc16c23d548ba8d5802c563d8ebdc
image

https://sketchfab.com/3d-models/unc-old-well-13f0b2efb35f4d13868e634a68b6465a

GLFast got the materials for the old well model right.
Both models rendered correctly in https://gltf-viewer.donmccurdy.com/

Steps to reproduce 🔢

Download the model and import

Files to reproduce the issue ♻

https://sketchfab.com/3d-models/lowpoly-generic-suv-police-259fc16c23d548ba8d5802c563d8ebdc

Editor Version 🎲

2021.3

Render Pipeline and version

URP

UnityGLTF Version

latest

Operating System 👩‍💻

Linux

When does this problem happen?

  • Editor Import
  • Runtime Import
  • Editor Export
  • Runtime Export

Additional Info 📜

No response

Validations 🩹

@hybridherbst
Copy link
Collaborator

hybridherbst commented Nov 13, 2024

Thanks for the report.

It's not clear what you're showing in your screenshot and what you're expecting to see. All I can see is a red skybox resulting in red lighting, and not if that's UnityGLTF, glTFast, or something else. We'll try importing the model but still, more info would be appreciated!

Also, please include the UnityGLTF version (when using the package) or commit SHA (when using the repo), "latest" is not clear enough.

@hybridherbst
Copy link
Collaborator

hybridherbst commented Nov 13, 2024

The "Old Well" model uses the deprecated KHR_materials_pbrSpecularGlossiness extension, which is not supported anymore. Some viewers may still support it, but UnityGLTF's newer ShaderGraph-based materials do not.

You can open the model with https://gltf.report/ to convert it (open it, accept the conversion, then click on "Export" on the right side). Then import it in Unity.

@hybridherbst
Copy link
Collaborator

hybridherbst commented Nov 13, 2024

The "Police Car" model looks almost identical between glTFast (left) and UnityGLTF (right):

image

It does seem like for both of them, the normal maps are decoded incorrectly.
Can you please also list:

  • exact Unity Editor version
  • your platform (Windows, Mac, ...)
  • your current build target
  • your normal map encoding settings in Unity

@KaminariOS
Copy link
Author

KaminariOS commented Nov 13, 2024

The "Police Car" model looks almost identical between glTFast (left) and UnityGLTF (right):
image

It does seem like for both of them, the normal maps are decoded incorrectly. Can you please also list:

* exact Unity Editor version

2022.3.45f1

* your platform (Windows, Mac, ...)

Linux

* your current build target

Quest 3. But it shouldn't matter because I set up a new project with PC target and got the same thing.

* your normal map encoding settings in Unity

How to check that? I never touched it so it may just be the default.

UnityGLTF commit sha: b99d85f

@KaminariOS
Copy link
Author

And also this model:https://sketchfab.com/3d-models/2023-honda-civic-type-r-8c9484184a2b4254aafd67418b8c18db
The windows are all dark but it is supposed to be transparent
image

@hybridherbst
Copy link
Collaborator

@KaminariOS related to the police car, can you please post screenshots of what you see on your end? I posted what I believe are pretty much identical screenshots above, with some normal map issue. Is that the issue you are seeing as well, or is that a different issue?

@KaminariOS
Copy link
Author

image
Yes. Look at the wheels. Somehow they look metallic.

@KaminariOS
Copy link
Author

After struggling with importing sketchfab model to Unity for a long time, I finally found a solution
Download the glb from Sketchfab, import it in Blender and export it as glb
The new glb will be usable in Unity(using the UnityGLTF plugin)

@hybridherbst
Copy link
Collaborator

Glad you found a workaround.

Please keep the issue open – this is a genuine problem. Converting the file in Blender will potentially result in data loss in some areas (e.g. the specular extension or the transmission extension, present in your files, might disappear).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants