Skip to content

Instantly share code, notes, and snippets.

@ku6ryo
Created November 10, 2021 09:38
Show Gist options
  • Select an option

  • Save ku6ryo/7e302c57a3592590ba350e6fa5c7c056 to your computer and use it in GitHub Desktop.

Select an option

Save ku6ryo/7e302c57a3592590ba350e6fa5c7c056 to your computer and use it in GitHub Desktop.
PeriodicEmission.shader
Shader "ku6ryo/PeriodicEmission"
{
// Slow blinking (depending on the time passed) emission effect shader made based on the Standard shader.
Properties
{
_Color ("Color", Color) = (1,0,0,1)
_Emission("Emission", Color) = (1,1,0,1)
_Glossiness ("Smoothness", Range(0,1)) = 0.5
_Metallic ("Metallic", Range(0,1)) = 0.0
}
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
#pragma surface surf Standard fullforwardshadows
#pragma target 3.0
struct Input
{
float2 uv_MainTex;
};
half _Glossiness;
half _Metallic;
fixed4 _Color;
fixed4 _Emission;
void surf (Input IN, inout SurfaceOutputStandard o)
{
o.Albedo = _Color.rgb;
o.Metallic = _Metallic;
o.Smoothness = _Glossiness;
o.Emission = _Emission.rgb * _SinTime.w;
o.Alpha = 1;
}
ENDCG
}
FallBack "Diffuse"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment