【发布时间】:2018-01-11 00:52:35
【问题描述】:
我想去掉树轮廓中的奇怪颜色区域。这是我的树精灵着色器代码:
Shader "Unlit/Transparent Color Z on 2" {
Properties {
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
_Color ("Main Color", Color) = (1,1,1,1)
}
SubShader {
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
LOD 100
ZWrite On Blend One OneMinusSrcAlpha Cull Off
//ZTest Always
Blend SrcAlpha OneMinusSrcAlpha
Pass {
Lighting Off
SetTexture [_MainTex] {
constantColor [_Color]
Combine texture * constant, texture * constant
}
}
}
}
另外,一棵树的排序顺序是7,背景砖的排序顺序是14。树的z位置是-11,砖的z位置是-8.8。
【问题讨论】: