20
> -[MTLDebugRenderCommandEncoder setScissorRect:]:2028: failed assertion (rect.x(0) + rect.width(1080))(1080) must be <= 240

I am getting this crash when adding a simple SKSpriteNode to a SKEffectNode with the following code

    SKSpriteNode *warpSprite = [SKSpriteNode spriteNodeWithImageNamed:@"art.scnassets/symbol.png"];
    SKEffectNode *entryEffectsNode = [[SKEffectNode alloc] init];
    [entryEffectsNode addChild:warpSprite];
    [self addChild:entryEffectsNode];

I have not touched these nodes anywhere else in my project, when i change the sprite the value in (must be <=value) changes within the error.

Edit: I have replaced the sprite image with a simple spriteNodeWithColor:Size: and the (<=value) is always twice size of the sprite. Also it should be noted that the SKScene is being used as a overlay in a SceneKit scene.

I have created a seperate SKScene with the following code, which still results in the same error.

@implementation testScene
    
    -(id)initWithSize:(CGSize)size {
        if (self = [super initWithSize:size]) {
            
            SKSpriteNode *testSprite = [SKSpriteNode spriteNodeWithColor:[SKColor purpleColor] size:CGSizeMake(100, 100)];
            SKEffectNode *testEffect = [[SKEffectNode alloc] init];
            [testEffect addChild:testSprite];
            [self addChild:testEffect];
            
        }
        return self;
    }
@end

Edit 2: I have just tested the above scene as an overlay on a default SceneKit Project and it crashes with the same error.

Edit 3: I have reproduced this using swift. Bug report summited to Apple.

naide
  • 293
  • 3
  • 14
user3765506
  • 457
  • 1
  • 5
  • 15
  • your rect is greater than what is supported, [SKSpriteNode spriteNodeWithImageNamed:@"art.scnassets/symbol.png"] should be [SKSpriteNode spriteNodeWithImageNamed:@"symbol"] so that it can properly handle retina graphics, Other than this, we would need to know more – Knight0fDragon Feb 24 '17 at 15:40
  • With this changed i still get the same error. What else would you need to know? I have just run the same code in a new project and it works as you would expect. I have replaced the sprite image with a simple spriteNodeWithColor:Size: and the (<=value) is always twice size of the sprite. – user3765506 Feb 25 '17 at 05:56
  • 1
    Might be a bug. [File one with Apple](http://bugreport.apple.com) to be sure. – rickster Feb 28 '17 at 21:07
  • Are you certain your initWithSize method is called on the main thread ? When using a SKScene as a SCNScene overlay, all SKNode operations must be run from the main thread. – stipus Dec 16 '19 at 10:44
  • What is the current status on your bug report? – KugelnMMXVI Sep 13 '20 at 09:48

0 Answers0