unity3d - Trail renderer always black? -


for reason 2d trail renderer stays black no matter change color. idea why?

enter image description here

the answer easy. use mobile/diffuse shader not accept main color multiply texture. need shader has main color. can use (it varation of mobile/diffuse main color)

    shader "mobile/diffuse color" {     properties {         // adds color field 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 'constant' variable                 constantcolor [_color]                  // multiplies color (in constant) texture                 combine constant * texture             }          }     }      fallback "mobile/vertexlit" } 

also should use texture, can 2x2 resolution white pixels. color textures same color choosen in trail renderer.


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -