- 수정됨
Unity Depth Issue
Hi guys,
I get a problem at certain camera angles where Spine characters which has greater depth end up rendering in front of the other ones.
I believe its an issue with the spine shader, as with others I do not get the depth issue. (but they don't render right)
I'm on the latest runtimes (27th July)
Try this:
Even if you have a Perspective Camera
, attach a small script to your camera, and set the camera's .transparencySortMode
to TransparencySortMode.Orthographic
. You can probably do this in Awake
or Start
.
(You can also let some kind of manager do this for you. I actually don't know if this setting serializes into the scene/prefab.)
What this does is make it sort renderables according to flat-plane-distance instead of actual diagonal distance from the camera point.
Let us know if this solution works for you!
Thanks for the quick reply Pharan, I will give it a try later this week!
**Update
I can confirm this works, here's a handy script for you to copy pasta...
using UnityEngine;
using System.Collections;
public class CameraTransparencyMode : MonoBehaviour
{
public TransparencySortMode m_TransparencySortMode = TransparencySortMode.Default;
// Use this for initialization
void Start ()
{
camera.transparencySortMode = m_TransparencySortMode;
}
}