Sheado

Howdy,

I'm trying to get setVertexZ() to work on CCSkeletonAnimation. Is this at all possible with the current version of the spine cocos2d-x runtime?

I tried following the cocos2d-x sample code in SpriteTest.cpp (see function SpriteBatchNodeZVertex::SpriteBatchNodeZVertex()). I tried both the batching and non-batching solutions and neither worked (CCSkeletonAnimation objects did not change drawing order regardless of their vertexZ values).

I'm note sure what the shader, kCCShader_PositionTextureColorAlphaTest, is doing and what is different about CCSkeletonAnimation. My guess is it might have to do with the fact that there's no batching, yet atlases are being used. I'm hoping that once batching is added it will be possible to use kCCShader_PositionTextureColorAlphaTest on CCSkeletonAnimation objects and in turn be able to setVertexZ to change draw order.

In the meantime though, is there any way to hack together a simple solution to get z ordering working properly on CCSkeletonAnimation objects?

Thanks!
-Chad
Sheado
  • Сообщения: 66

Sheado

Oops, scratch all that.
I didn't have depth test enabled: CCDirector::sharedDirector()->setDepthTest(true);

Setting that to true fixes the problem, but there is pixelation when objects overlap. I guess I'll be looking into that next.
Sheado
  • Сообщения: 66

Nate

Good find. The deep, dark depths of cocos2d-x are a mystery to me. :)
Аватара пользователя
Nate

Nate
  • Сообщения: 9766


Вернуться в Runtimes