Search code examples
iosxcode3dscenekitcinema-4d

"dae" 3D model side become transparent in iOS app


I'm new to 3D models and try to make my test game in SceneKit

I use Cinema 4D on Windows PC for creating 3D models.

I want to add my texture with a transparent background on a side of a 3D object.

But my texture makes the cube's side transparent instead of keep as it was.

In Cinema 4D it displays as intended. enter image description here

On macOS Preview it looks transparent. The same for launched app on iOS enter image description here

In XCode it looks

enter image description here

Here is my 3D model(zipped "dae" file)

I've googled a lot, found some info like but it didn't help.

PS Thanks for your time. I'm a newkid in 3D games, any advice are welcome.


Solution

  • This is because the texture is transparent, which SceneKit interprets as you wanting a non-opaque material. In SceneKit you can't have multiple layers of materials with for instance a transparent image and some other opaque material for the same face. Instead you should use an opaque texture with a background color matching the color of the other faces of the cube.