简体   繁体   中英

CIFilter on SKScene

I am working on a simple game with Sprite Kit. What I need to do is to apply Black & White filter on the whole scene. This is my code:

self.filter = [CIFilter filterWithName:@"CIColorControls"];
[self.filter setDefaults];
[self.filter setValue:@1 forKey:kEffectKeySaturation];
self.shouldEnableEffects = YES;

It works perfect, but the point is that the game gets stuck for a moment and I got this message in log:

BSXPCMessage received error for message: Connection interrupted

Am I doing something wrong? How to get rid of this message?

I encountered the same problem, for some reason in iOS 8 it is connected with the following line:

self.shouldEnableEffects = YES;

I experienced it using Swift and found that even blank SKScene with no children gives this error after setting this property to YES . I suppose the effects are enabled (by software renderer) by default in iOS 8, but it's only a guess.

In my experience, this error caused nasty problem where SKShader 's stopped rendering. You can get rid of it by deleting the mentioned line.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM