Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to actiavate shadows on this shader

Discussion in 'Shaders' started by Cato_xyz, Apr 21, 2014.

  1. Cato_xyz

    Cato_xyz

    Joined:
    May 18, 2013
    Posts:
    60
    Hey, im working with this Custom Shader, it works great for my needs but i still need it to receive shadows.
    I'm not programmer, this shader is going to be used for a Retro-Remake constest from the next thread: http://forum.unity3d.com/threads/238307-quot-Retro-Remake-quot-Mapping-Contest-Deadline-April-31st

    I'll appreciate any help with this, Thanks in advance!

    Shader "Color with Detail" {
    Properties {
    _Color ("Main Color", Color) = (0.7,0.7,0.7,1)
    _MainTex ("Base (RGB)", 2D) = "white" {}
    _DetailTex ("Detail (RGB)", 2D) = "white" {}
    _BumpMap ("Normalmap ", 2D) = "bump" {}
    }
    SubShader
    {
    Pass {

    Lighting On


    SetTexture [_MainTex] {
    constantColor [_Color]
    Combine texture * constant, texture
    }


    SetTexture [_DetailTex] {
    Combine texture * previous DOUBLE, previous
    }
    }
    }
    }
     
  2. jvo3dc

    jvo3dc

    Joined:
    Oct 11, 2013
    Posts:
    1,520
    Just add a fallback to a vertexlit shader. The shadow shaders need to be defined separately or you can just reuse them through a fallback.