Unity3d Unity着色器:可以修复此着色器吗?
我想去掉树轮廓中奇怪的颜色区域。以下是我的着色器的树精灵代码:Unity3d Unity着色器:可以修复此着色器吗?,unity3d,shader,Unity3d,Shader,我想去掉树轮廓中奇怪的颜色区域。以下是我的着色器的树精灵代码: 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" "IgnoreProj
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 您注释掉了“ZTest-everys”,因此使用了回退“ZTest-LEqual”。您看到的轮廓是正在写入Z缓冲区的网格(在“精灵属性”中使用“紧密”选项),从而阻止正确绘制砖块