Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/unity3d/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Unity3d Unity着色器:可以修复此着色器吗?_Unity3d_Shader - Fatal编程技术网

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缓冲区的网格(在“精灵属性”中使用“紧密”选项),从而阻止正确绘制砖块