Writing · 20 August 2019

Simple single colour shader in unity with transparency

It’s kind of annoying that Unity doesn’t come with an unlit color shader that you can change the alpha value. So here one is. Instructions:

  1. From the ‘Create’ menu in the ‘Project’ window, select ‘Shader’ => ‘Unlit Shader’.
  2. Open the file that is created and copy paste the below.
  3. Finally, drag your shader onto your material, or select the shader in the material in the inspector window.
Shader "Unlit/Transparent Colored" {
    Properties {
        _Color ("Main Color", Color) = (1,1,1,1)
    }

    SubShader {
        Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}

        ZWrite Off
        Lighting Off
        Fog { Mode Off }

        Blend SrcAlpha OneMinusSrcAlpha 

        Pass {
            Color [_Color]
        }
    }
}

← Planet Juggle now available to download for Oculus Rift and Quest!Flow Zone wins 3rd Place at Siggraph Asia →

in fiction

Featured

December 23, 2015

Back to Earth

December 23, 2015

Read more →

December 23, 2015

December 9, 2015

a tree as the air moves

December 9, 2015

Read more →

December 9, 2015

Once Upon a Universe

December 9, 2015

Once Upon a Universe

December 9, 2015

Read more →

December 9, 2015


Where do we come from, where are we going, how do we get there?

musings on everything and nothing