Reuben Kiblitsky
Reuben Kiblitsky

Reputation: 11

3D Models in Scenekit

I purchased 3D Models to use in SceneKit, but I am having trouble making the model appear like the final product shown on the sites where I buy them from. I have been purchasing .obj files and converting them in Xcode. I was able to successfully complete one model, but I have 5 others all running into the same problem.

As you can see, I would like it to look like this (picture from the site I purchased it from) Image 1

But when I move the .obj file (came with many more as well) this is where it gets confusing. The model has a lot of materials (which I don't understand as well) and when I try to add one of the textures through "Diffuse" it doesn't work at all. This is the best I got.Image 2

The textures also don't seem right, these are all of them but I don't understand even if they linked up, how it would achieve the shiny metal look? Thanks. Image 3

The materials look like this and there are tons that are repetitive (over 100) Image 4

Any guidance will be appreciated. Thank you!

Upvotes: 1

Views: 2289

Answers (1)

SWAT
SWAT

Reputation: 1158

You will need to understand how a material is applied on a 3D object. A .obj file will not have a material applied on it, but will have image files, which would then be UV mapped around the 3D object. The diffuse image that you just added to the object is in simple terms, the colour of the surface of the material.There are different components that can be applied on the 3D object, like specular, normal, occlusion, etc. Of course just applying the diffuse component was not going to give you a good enough result.

This Unity doc is what made me understand what each of these components are and what they do when applied on an object. https://docs.unity3d.com/Manual/StandardShaderMaterialParameters.html

This is pretty much similar to what we use in SceneKit, and you should be able to pick up how the map is to be applied on your 3D model.

Basically, this is what happens when you correctly apply the maps to the 3D model: enter image description here

Another thing that you might want to look into is PBR(Physically Based Rendering) Depending on the 3D Model you purchased, maybe you would find this helpful. https://developer.apple.com/videos/play/wwdc2016/609/ This WWDC video should give you an understanding of how PBR works. Also, https://medium.com/@avihay/amazing-physically-based-rendering-using-the-new-ios-10-scenekit-2489e43f7021

Upvotes: 1

Related Questions