I have a SpriteKit game in which there are balls that bounce around. Despite using a texture atlas (a .spriteatlas folder located in my .xcassets folder), I'm getting 2 draw calls for each ball.
Some facts:
- The balls are
SKSpriteNode
's. - Each ball is a parent node that has a child node (an overlay with the opposite rotation of the ball to provide the illusion of lighting/shadow). So, we're talking about 2 nodes for each ball.
- The balls' textures are preloaded up front and stored in memory via
textureNamed(_:)
. - I have set
view.ignoresSiblingOrder = true
. - There is no SpriteKit background image that would make the balls render on top of another node; the background is transparent. So, the balls do not overlap other content.
zPosition
is not set -- not on the parent and not on the child.
Based on what I've learned about how the scene is rendered, I would expect to see all the parent nodes rendered in a single pass, with additional passes for the child nodes (though, even that is suspicious since I have ignoresSiblingOrder
set to true
).
What am I not understanding, here? Why does my draw count increase so drastically as more balls are added to the scene?
Thank you!
UPDATE:
If I don't add the child nodes to the balls, the draw count for the balls is 1 regardless of how many balls there are. So, it's definitely an issue with the child nodes, not the parents.