nihal

Hi,

I have a scene with a complex terrain. The terrain is being rendered through libgdx meshes - the terrain is not rendered using spine, but standard Libgdx using a simple shader, with alpha blend and depth sorting enabled.

My problem is that I cannot get spine to render animation between (or in front of) my meshes - my characters are always hiding below the terrain. Is there some trick to enabling depth sorting for spine in Libgdx?
nihal
  • Posts: 14

badlogic

Is the terrain a 3D rendering using the z-buffer? Or are you talking about 2D/isometric rendering?
User avatar
badlogic

Mario
  • Posts: 1936

nihal

Hi,

I am using the z-buffer. Though strictly speaking it is pseudo 3D.
nihal
  • Posts: 14

badlogic

It's been a while since I worked with libGDX, but I believe if you use SpriteBatch or PolygonBatch, the z-buffer writes and testing will be disabled. You'll have to enable those when drawing your skeletons. Also remember that the skeletons will be rendered at z-coordinate 0. You can offset on the z-axis by providing a transformation matrix to the SpriteBatch or PolygonBatch.
User avatar
badlogic

Mario
  • Posts: 1936

nihal

Hi,

I solved my issue by writing a custom AnimationRenderer, that works using using Meshes instead of Sprites. I then rendered it using my own custom shader.

This gave me much more control over the rendering procedure.
nihal
  • Posts: 14


Return to Runtimes