Search Unity

ColorMatrix (adding diffuse shader)

Discussion in 'Scripting' started by Justin_Wingfall, Mar 12, 2021.

  1. Justin_Wingfall

    Justin_Wingfall

    Joined:
    May 15, 2014
    Posts:
    125
    Im trying to use lighting with this tool but it's default shader doesn't support lights, could someone please help me out, it would be help me out greatly. thanks
    https://assetstore.unity.com/packages/tools/particles-effects/colormatrix-139463

    I put in "on" next to Lighting, nothing happen.



    Shader "Wonderland/Sprite-Default ColorMatrix"
    {
    Properties
    {
    [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
    _Color ("Tint", Color) = (1,1,1,1)
    [MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
    [HideInInspector] _RendererColor ("RendererColor", Color) = (1,1,1,1)
    [HideInInspector] _Flip ("Flip", Vector) = (1,1,1,1)
    [PerRendererData] _AlphaTex ("External Alpha", 2D) = "white" {}
    [PerRendererData] _EnableExternalAlpha ("Enable External Alpha", Float) = 0
    }
    SubShader
    {
    Tags
    {
    "Queue"="Transparent"
    "IgnoreProjector"="True"
    "RenderType"="Transparent"
    "PreviewType"="Plane"
    "CanUseSpriteAtlas"="True"
    }
    Cull Off
    Lighting Off
    ZWrite Off
    Blend One OneMinusSrcAlpha
    Pass
    {
    CGPROGRAM
    #pragma vertex SpriteVert
    #pragma fragment SpriteFragCM
    #pragma target 3.0
    #pragma multi_compile_instancing
    #pragma multi_compile _ PIXELSNAP_ON
    #pragma multi_compile _ ETC1_EXTERNAL_ALPHA
    #pragma multi_compile_fog
    #include "UnitySpritesCM.cginc"
    ENDCG
    }
    }
    }