ios - Updating geometry in SpriteKit (or SceneKit) -
we porting game spritekit , i've run in bit of problem. objects in our game have triangle-strip trails attached them. vertex buffers of trails continuously updated objects move in world create seamless , flowing effect (there constraints on how many vertices in buffer , how emit new vertices).
in previous implementation updated affected vertices in corresponding buffer whenever emitted new vertices. in scenekit seems unable update geometry sources, unless use geometrysourcewithbuffer:vertexformat:semantic:vertexcount:dataoffset:datastride:
. however, seems need metal device, command queue , encoder, able submit commands update buffer before renders.
is there way can normal scnview
, or have manually cametallayer
, creating own metal device etc?
in essence, everything need, bar trail geometry available in spritekit, hoping there way hold of metal device , command queue used skview , use upload geometry. make things a lot simpler.
i've used particle system similar effect. particle emitter attached moving object, particles set fade out , die. might need set emitter's targetnode
scene, depending on effect want.
emitter = skemitternode() emitter.name = marblenodenames.trail.rawvalue emitter.particletexture = sktexture(imagenamed: "spark") emitter.particlealphaspeed = -1.0 emitter.particlelifetime = 2 emitter.particlescale = 0.2 marblesprite.addchild(emitter)
Comments
Post a Comment