What you’re seeing is not a problem with the way you create the nodes – it is a SceneKit / SpriteKit / Metal bug that appears as soon as an SKEffectNode finds itself inside an SKScene that SceneKit renders with Metal (which is the default in iOS 10).
The numbers in the assertion tell the story:
rect.x 0 + rect.width 1080 -> 1080 (SpriteKit asks Metal to draw 1080 px wide)
must be <= 240 -> 240 (the render target SceneKit has actually
allocated for the overlay)
SceneKit asks Metal for a render-target that is only 240 px wide (for performance it often renders the overlay scene at a fraction of the full resolution).
SpriteKit, however, computes its scissor rectangle in full-resolution pixel units (1080 px on an iPhone 6 Plus, for example). With Metal API validation enabled, the debug layer catches the mismatch and raises the assertion you see:
-[MTLDebugRenderCommandEncoder setScissorRect:]: failed assertion …
Placing even a single child in an SKEffectNode triggers SpriteKit’s “render-to-texture” path, which is why the crash happens as soon as you add the node.
Affected configurations
• iOS 10 (10.0 – 10.2.x).
• SceneKit rendered with Metal (the default) and an SKScene assigned to
SCNView.overlaySKScene or to an SCNMaterialProperty.
• Any use of SKEffectNode in that SpriteKit scene.
Work-arounds
Use OpenGL instead of Metal for SceneKit until Apple fixes the bug:
scnView.preferredRenderingAPI = .openGLES2 // or .openGLES3
(Must be set before the first frame is rendered.)
Remove or avoid SKEffectNode in the overlay scene.
• If you only needed it for convenience (to group nodes, for example) you can replace it with a plain SKNode.
• If you needed filters, prerender the effect into a texture in a separate SKView and use that texture in the overlay scene.
Disable Metal API validation.
The program will keep running, but Metal will silently render nothing where the effect node should be, so this is useful only if you need to ship quickly and do not rely on the effect.
Status / Fix
The bug was filed with Apple (e.g. rdar://30689604).
It is fixed starting with iOS 10.3 (and of course later releases, including iOS 11). On those OS versions you can freely use SKEffectNode in an overlay SKScene rendered with Metal.
So there’s nothing wrong with your code – either switch SceneKit to OpenGL until you can require iOS 10.3+, or drop SKEffectNode in the overlay scene.
Was this answer helpful?
version: o3-pro-2025-06-10
Status: UQ Validated
Validated: 8 months ago
Status: Needs Human Verification
Loading model reviews...
Loading reviews...