Search Unity

Solid color shader casting shadows.

Discussion in 'Shaders' started by Tymoteusz Kupcewicz, Mar 5, 2015.

  1. Tymoteusz Kupcewicz

    Tymoteusz Kupcewicz

    Joined:
    Feb 8, 2015
    Posts:
    3
    Hello everybody,
    It's my first time making a game and I've tried to find or write shader which casts shadows and shows color without any light or texture. It should cast shadows on a simple white plane. Now I have something like this:
    Code (CSharp):
    1. Shader "Solid Color" {
    2.  
    3. Properties { _Color ("Color", Color) = (1,1,1) }
    4.  
    5. SubShader { Color [_Color] Pass {} }
    6.  
    7. }
    8.  
    Would you tell me how to do it or give me some guide/tutorial about this?
    Thanks!
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,445
  3. Tymoteusz Kupcewicz

    Tymoteusz Kupcewicz

    Joined:
    Feb 8, 2015
    Posts:
    3
    Thanks mgear, I'll definetly take this tutorial, although if somebody has done shader I will be grateful.
     
  4. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,445
  5. Tymoteusz Kupcewicz

    Tymoteusz Kupcewicz

    Joined:
    Feb 8, 2015
    Posts:
    3
    I don't know if I understand correctly but doesn't unlit means it won't be affected by any light? So it won't cast shadows which I want?