How to apply full-screen SKEffectNode for post-processing in SpriteKit

后端 未结 1 1471
死守一世寂寞
死守一世寂寞 2021-01-12 20:20

I\'m trying out SpriteKit with the following setup:

  1. An SKScene with two child nodes used merely for grouping other nodes: foreground and background.
  2. b
相关标签:
1条回答
  • 2021-01-12 20:44

    It seems to be a bug with the SKEffectNode trying to apply a filter on children SKShapeNodes as far as I can tell. I played around with this and achieved your results, but when I switched out the SKShapeNodes for SKSpriteNodes (using a simple png of a circle) the cropping no longer appears. It's a bug in that SKEffectNode doesn't handle the stroke of the SKShapeNode very well. If you take off the stroke (lineWidth = 0) and give it a fill color, you'll see that there is no cropping.

    As for the frame rate, SKShapeNodes perform poorly. Doing the switch to SKSpriteNodes I mentioned earlier boosted my fps from 40 to 50 when I had 35 nodes on the screen (iPhone 5) with the filter applied.

    0 讨论(0)
提交回复
热议问题