Anisoft

I was experimenting with the Pixel Lighting shader and point lights, and noticed that the z-spacing seems to move the wrong pieces.

You can see that some pieces should be in front (feet) while others should be behind. This shader seems to move the wrong ones when changing spacing.

If I move the camera to the otherside the order is correct, however that's the backside cause when I turn on back face culling that side gets culled out.

When trying out the vertex shader I found this not to be an issue. Likely because the pieces draw works differently under that shader.

Am I doing something wrong?

Anisoft
  • Сообщения: 39

Harald

Are you sure that you haven't rotated the GameObject by 180 degrees or anything like that? Z-Spacing moves the parts in the direction so that draw order is preserved. Is your draw-order correct when using e.g. the unlit Spine/Skeleton shader?
Аватара пользователя
Harald

Harri
  • Сообщения: 1098

Anisoft

Yes using unlit and the vertex lit works as expected.

When I set back face culling on I can see that it's correctly facing the right direction too. It isn't flipped as far as I can tell.

Ill double check again tho

Edit* Turns out I did have the camera flipped. I'm sorry for wasting your time, apologies!
Anisoft
  • Сообщения: 39

Harald

Thanks for getting back to us! I would not have thought of a flipped camera, that's an interesting option to consider! :)
Аватара пользователя
Harald

Harri
  • Сообщения: 1098


Вернуться в Unity