magicien / GLTFSceneKit

glTF loader for SceneKit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problematic Models

AlicanC opened this issue · comments

commented

Hey, thanks for the great library! I have been experimenting with some models from Sketchfab with the sample macOS app and I've found a few models that have problems.

The following models have no texture:
https://sketchfab.com/models/d237537968c8474abfd43a258c415304
https://sketchfab.com/models/5f28af46bb6b42de8a1045d92300f771
https://sketchfab.com/models/fd8fc2a6e9d9441c9b5338cf384b4b6b

The following model crashes:
https://sketchfab.com/models/c2bd67e2fc644dfb9a80def2f773a5e5

It would be great if we could figure out what's going on.

Thanks in advance!

Hi, AlicanC. Thank you for your comment.
I checked the models and I had the same issue.

The problem is that GLTFSceneKit doesn't support KHR_materials_pbrSpecularGlossiness extension so far. I'm going to implement it.

I'm not sure about the crashed one, but I guess it's because the app outputted too many logs. Without debugging, it can show the model.

commented

Hey, I have made a non-complete implementation that fixed two of those that didn't show texture:
AlicanC@78eb175

Great Job!
I guess glossinessFactor should look like this;
material.roughness.contents = createGrayColor(white: (1.0 - data.glossinessFactor))
but I'm not sure how to use specularFactor.

commented

I will try it if I find any models that have non-default values for those.

Great! Now we can calculate baseColor and metalness.
For performance, it seems to be better to convert image data before sending textures to GPU, but it makes it difficult to animate values.
Making a shaderModifier to convert values could be good for the first step.

I made add-specular-glossiness-support branch.

The spider model seems to have too large textures. When I tried downsized textures (8192 x 8192), it worked. I'm thinking of adding a feature to downsize large textures.

spider_screenshot

I merged add-specular-glossiness-support branch to master.
Now you can see textures for the first 3 models.