Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CIFilter not updating after setValue in iOS 10

I have an application using SpriteKit. I made a simple transition using a SKEffectNode which has a CIFilter, which I apply a setValue to change the filter's parameters on every update (using SpriteKit's built in update loop method) according to some function.

This worked perfectly fine on iOS 9 and before I upgraded to Swift 3, although I don't think the Swift version has anything to do with it.

Now, I get a frame with the first parameter value, which persists until the final parameter value. What has changed from iOS 9 to iOS 10 here?

like image 308
jyoung Avatar asked Oct 28 '25 03:10

jyoung


1 Answers

I noticed that I was enabling shouldEnableEffects at the beginning of my timer, and disabling it at the end, and this corresponded to the filter values I was observing on screen.

Setting shouldEnableEffects to true after every call to setValue fixed the problem, so that I see the filter being changed on every update. Not sure if this is a hack, or if something changed in SpriteKit or iOS 10 for performance or optimization reasons.

like image 65
jyoung Avatar answered Oct 29 '25 20:10

jyoung



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!