Keeping with the frontiersman theme for the first week. Kit Carson, a man who’s love for chili is legendary.

I made a thing!

I took my first try at writing a shader for Unity. It’s for a space shootie game I’ve been tinkering with.

Here’s the code!


    Shader "Custom/Vertex Color Chanels FX" {
        Properties {
            _Color ("Main Color", Color) = (0.5,0.5,0.5,1)
            _EmitColor ("Emission Color", Color) = (1,1,1,1)
            _FxColor ("Effects Color", Color) = (1,1,0,1)
            _Speed ("Speed", Range(1,255)) = 0.5
        }
        SubShader {
            Tags { "RenderType"="Opaque" }
            LOD 200

            CGPROGRAM
            #pragma surface surf Lambert

            float _Speed;
            sampler2D _Ramp;
            float4 _Color;
            float4 _EmitColor;
            float4 _FxColor;

            struct Input {
                float4 color: COLOR;
            };

            void surf (Input IN, inout SurfaceOutput o) {
                float4 c = IN.color;
                float pulse = 0.5 * ( 1 + sin(2 * 3.14 * _Speed * _Time));
                o.Emission =  (_EmitColor * c.g) + (c.b * (_FxColor + pulse * 0.5));
                o.Albedo = _Color * c.r;
            }

            ENDCG
        }
        FallBack "VetexLit"
    }