IndieDoroid

Hi @Harald @Erika,

I'm having lots of clipping issues between my characters. I tried using sorting groups, z spacing but it doesn't work.

Currently I physically offset the character's "z position" ... but I can't separate them too far apart or they look like they are standing in different z planes.

Could you please provide some suggestions? :wounded:
Thanks for the help
No tienes los permisos requeridos para ver los archivos adjuntos a este mensaje.
Avatar de Usuario
IndieDoroid
  • Mensajes: 147

Harald

Which shader are you using? If you are using a Spine shader: does it have ZWrite (depth write) enabled?
Avatar de Usuario
Harald

Harri
  • Mensajes: 1727

IndieDoroid

Hi @Harald,

Sorry I'm having trouble finding it ...

btw I'm using the official Spine shaders now, not ToddRiver's shaders from a couple of years ago. :zipper:
screenshot.5.jpg
No tienes los permisos requeridos para ver los archivos adjuntos a este mensaje.
Avatar de Usuario
IndieDoroid
  • Mensajes: 147

Harald

Thanks for posting the shader settings. Spine/Sprite/Pixel Lit is one of the few Spine shaders who use fixed ZWrite On setup. Sorting Groups will only help ordering objects that are not writing to the Z buffer. Unfortunately, ZWrite is requried at this shader because of the separate "ForwardAdd" pass.

So in your case you could:
  • a) Switch to Spine/Sprite/Vertex Lit which will still evaluate normalmaps etc on the pixel level.
  • b) Create your own copy of Spine/Sprite/Pixel Lit with the "ForwardAdd" pass removed (IIRC the main light should be respected, additional lights would then be ignored) and changing ZWrite On to ZWrite Off in the main "ForwardBase" pass.
  • c) When both your camera and the SkeletonAnimation GameObjects are not rotated (perfectly parallel), you can change Z-Spacing to 0 safely. It will only cause Z-fighting problems when the triangles are angled in relation to the camera near/far planes.
  • d) As you already suggested, you could offset the character's z position. Here a minimal value should be enough (otherwise move your camera's near-plane farther away or the far-plane closer to improve z buffer precision).
Avatar de Usuario
Harald

Harri
  • Mensajes: 1727


Volver a Unity