2013-05-29 102 views
2

我有3种不同的平面:前景,中间地面和背景。出于某种原因,进一步的背板会在我的前景平面上定期渲染。远离Unity3D重叠近距离物体的物体

在场景视图中,您可以看到波浪更接近相机,然后是背景。 enter image description here

然而,在游戏中的背景有时会显示上层建筑的接近飞机,如本屏幕截图: enter image description here

我使用透视相机。

+0

单位标记用于Microsoft Unity。请不要滥用它。 –

回答

2

我认为你应该能够改变着色器的渲染顺序。这个解决方案不能很好地推广,因为你需要为每架飞机设计一个独特的着色器。

因此,例如,修改transparency order,你可能有ShaderFar:

Shader "TransparentFar" { 
    SubShader { 
     Tags {"Queue" = "Transparent" } 
     Pass { 
      // rest of the shader body... 
     } 
    } 
} 

而且ShaderNear:

Shader "TransparentNear" { 
    SubShader { 
     Tags {"Queue" = "Transparent+1" } //**note the +1 
     Pass { 
      // rest of the shader body... 
     } 
    } 
} 

内置着色器可以downloaded here,应该是很容易适应。

+0

谢谢Jerdak,那正是我在找的! – joe

相关问题