1

出于某种原因,无论我如何更改颜色,2D 轨迹渲染器都会保持黑色。知道为什么吗?

在此处输入图像描述

4

3 回答 3

3

据我所知,尾部渲染器需要一个精灵着色器。您使用的是标准着色器,因此照明计算会错误。

于 2015-11-03T13:10:29.543 回答
1

答案很简单。您使用不接受主颜色的移动/漫反射着色器来增加纹理。您需要具有Main Color的着色器。您可以使用我的(它是Mobile/Diffuse的变体,但带有Main Color

    Shader "Mobile/Diffuse Color" {
    Properties {
        // Adds Color field we can modify
        _Color ("Main Color", Color) = (1, 1, 1, 1)        
        _MainTex ("Base (RGB)", 2D) = "white" {}
    }

    SubShader {
        Tags { "RenderType"="Opaque" }
        LOD 100

        Pass {
            Lighting Off

            SetTexture [_MainTex] { 
                // Sets our color as the 'constant' variable
                constantColor [_Color]

                // Multiplies color (in constant) with texture
                combine constant * texture
            } 
        }
    }

    Fallback "Mobile/VertexLit"
}

你也应该使用一些纹理,它可以是 2x2 分辨率的白色像素。它将使用与 Trail Renderer 中选择的颜色完全相同的颜色为纹理着色。

于 2016-03-17T11:48:41.917 回答
0

尝试更改不同的材料(无论您添加的材料数量)并将颜色更改为任何颜色,至少它是明亮的。确保将 alpha 设置为 255 以保持可见性

于 2016-03-17T09:29:12.200 回答