SpriteKit shader crash iOS 9: SKDefaultShading, gl_FragCoord

前端 未结 4 2078
小蘑菇
小蘑菇 2021-02-20 02:51

Just installed the iOS 9 open beta (version 3) and now I\'m having loads of problems with SpriteKit shaders. On iOS 8 the following code worked just fine:

_fontS         


        
4条回答
  •  暖寄归人
    2021-02-20 03:36

    My custom SKShader also stopped working in ios9 on metal devices.

    I was able to fix it using v_tex_coord to get the pixel position, and custom uniform to send in the sprite size (There seems to be a bug where u_sprite_size isn't being passed in.)

    [SKUniform uniformWithName:@"u_fixed_size" floatVector2:GLKVector2Make(n.calculateAccumulatedFrame.size.width, n.calculateAccumulatedFrame.size.height)]
    

提交回复
热议问题