Hello there 👋
I've noticed a different behavior between iOS 15 and iOS 16 using CIFilter and SpriteKit. Here is a sample code where I want to display a text and apply a blurry effect on the same text in the back of it.
Here is the expected behavior (iOS 15):
And the broken behavior on iOS 16:
It looks like the text is rotated around the x-axis and way too deep.
Here is the sample code:
import UIKit
import SpriteKit
class ViewController: UIViewController {
var skView: SKView?
var scene: SKScene?
override func viewDidLoad() {
super.viewDidLoad()
skView = SKView(frame: view.frame)
scene = SKScene(size: skView?.bounds.size ?? .zero)
scene?.backgroundColor = UIColor.red
view.addSubview(skView!)
skView!.presentScene(scene)
let neonNode = SKNode()
let glowNode = SKEffectNode()
glowNode.shouldEnableEffects = true
glowNode.shouldRasterize = true
let blurFilter = CIFilter(name: "CIGaussianBlur")
blurFilter?.setValue(20, forKey: kCIInputRadiusKey)
glowNode.filter = blurFilter
glowNode.blendMode = .alpha
let labelNode = SKLabelNode(text: "MOJO")
labelNode.fontName = "HelveticaNeue-Medium"
labelNode.fontSize = 60
let labelNodeCopy = labelNode.copy() as! SKLabelNode
glowNode.addChild(labelNode)
neonNode.addChild(glowNode)
neonNode.addChild(labelNodeCopy)
neonNode.position = CGPoint(x: 200, y: 200)
scene?.addChild(neonNode)
}
}