Noobass
Noobass

Reputation: 2014

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?

Upvotes: 0

Views: 536

Answers (1)

Wladek Surala
Wladek Surala

Reputation: 2629

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.

Upvotes: 1

Related Questions