Error loading texture

Hi,

I'm loading a .dae file (a height grid from Blender, with no texture), and when creating a textured diffusematerial, in the simulator all goes well, but when loading in the Apple TV, I get a purple texture and the following error:

2015-09-21 09:43:43.737 Fighter[186:4815] error building shaders : Error Domain=AGXMetalG4P Code=1 "Vertex attribute 6 is not defined in the vertex descriptor." UserInfo={NSLocalizedDescription=Vertex attribute 6 is not defined in the vertex descriptor.}


As simulator does not support Metal, I'm supposing it is something related with that, but I don't know where to start.


Any help?

Thanks

Accepted Reply

After a bit of googling found the reason that was causing the problem. It is needed to make an UV Map of the object in order to make a texture. Looking up in google 'UV Mapping blender' will throw many examples and guides.

Replies

Update: changing the default renderer to GL fixes the problem, so it is something tied to Metal.

I'm having a similar issue. How do you change the default renderer? I can't seem to find that option anywhere in Xcode. Thanks!

You can change the render engine by selecting the SCNView of your View Controller, and clicking in the Attributes inspector at the right side of IB. The second entry is labeled 'Rendering API'.

Excellent! Thank you

After a bit of googling found the reason that was causing the problem. It is needed to make an UV Map of the object in order to make a texture. Looking up in google 'UV Mapping blender' will throw many examples and guides.