Search Unity

How do I change an unlit shader to lit?

Discussion in 'Shaders' started by FloryanAiros, Nov 28, 2021.

  1. FloryanAiros

    FloryanAiros

    Joined:
    Mar 25, 2020
    Posts:
    2
    So I recently downloaded the farm animals set from the asset store (https://assetstore.unity.com/packages/3d/farm-animals-set-97945#description) and it looks good, but the sheep is not receiving light or making shadows. I know this is because of the reason that the shader it is using is unlit, but I'm not experienced enough to change the shader to lit.

    Code (CSharp):
    1. Shader "VertexColorFarmAnimals/VertexColorUnlit" {
    2. Properties {
    3.     _MainTex ("Texture", 2D) = "white" {}
    4. }
    5. Category {
    6.     Tags { "Queue"="Geometry" }
    7.     Lighting Off
    8.     BindChannels {
    9.         Bind "Color", color
    10.         Bind "Vertex", vertex
    11.  
    12.     }
    13.     SubShader {
    14.         Pass {
    15.             SetTexture [_MainTex] {
    16.                 combine primary
    17.             }
    18.         }
    19.     }
    20. }
    21. }
    It isn't that big of a code really, so if anyone could help I would be thankful. I read that it would only actually work if the object with the shader (the sheep) already has a texture assigned, but I don't know if that is the same as what has happened here.