Summary: when I use SCNRenderer and call it's prepareObject:shouldAbortBlock: method scene kit trace error. and 3D model draw error!
errlog:
2018-01-02 14:52:35.672787+0800 QQKSong[1024:244239] [SceneKit] Error: 1: #extension GL_OES_standard_derivatives : enable
2018-01-02 14:52:35.672890+0800 QQKSong[1024:244239] [SceneKit] Error: 2:
2018-01-02 14:52:35.672950+0800 QQKSong[1024:244239] [SceneKit] Error: 3: precision highp float;
2018-01-02 14:52:35.673003+0800 QQKSong[1024:244239] [SceneKit] Error: 4: #define USE_DIFFUSETEXCOORD
2018-01-02 14:52:35.673055+0800 QQKSong[1024:244239] [SceneKit] Error: 5: #define USE_EMISSION_MAP
2018-01-02 14:52:35.673103+0800 QQKSong[1024:244239] [SceneKit] Error: 6: #define USE_TEXCOORD ... program: ERROR: 0:307: Structure has no field named specularTexcoord ERROR: 0:421: No matching function for call to mix(int, float, float) ERROR: 0:423: No matching function for call to mix(int, float, float) 2018-01-02 14:52:35.781173+0800 QQKSong[1024:244239] [SceneKit] Error: program failed to build:
2018-01-02 14:52:35.781213+0800 QQKSong[1024:244239] [SceneKit] Error: C3DResourceManagerMakeProgramResident failed to compile program - fallback on default program
Steps to Reproduce:
this is problem code:
EAGLContext *context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
[EAGLContext setCurrentContext:context];
NSURL *fileUrl = [NSURL fileURLWithPath:@"/System/Library/PrivateFrameworks/AvatarKit.framework/puppets/unicorn/unicorn.scnz"];
NSError* err = nil;
SCNScene *scene = [SCNScene sceneWithURL:fileUrl options:nil error:&err];
SCNRenderer* render = [SCNRenderer rendererWithContext:context options:nil];
render.scene = scene;
[render prepareObject:self.scene shouldAbortBlock:nil];
Use 3D model in AvatarKit.framework