|
Shader "MyShader/Scan01"
|
|
{
|
|
Properties
|
|
{
|
|
_Color("Color", Color) = (1,1,1,1)
|
|
_Emissionstr("Emissionstr", Float) = 0
|
|
_Masktex("Masktex", 2D) = "white" {}
|
|
_Gridlinetex("Gridlinetex", 2D) = "white" {}
|
|
_Gridlinestr("Gridlinestr", Float) = 1
|
|
_Scantex("Scantex", 2D) = "white" {}
|
|
_Scanstr("Scanstr", Float) = 0.2
|
|
_Scanspeed("Scan speed", Float) = 0.5
|
|
[HideInInspector] _texcoord( "", 2D ) = "white" {}
|
|
[HideInInspector] __dirty( "", Int ) = 1
|
|
}
|
|
|
|
SubShader
|
|
{
|
|
Tags{ "RenderType" = "Transparent" "Queue" = "Transparent+0" "IgnoreProjector" = "True" "IsEmissive" = "true" }
|
|
Cull Back
|
|
ZWrite Off
|
|
Blend One One
|
|
|
|
CGPROGRAM
|
|
#include "UnityShaderVariables.cginc"
|
|
#pragma target 3.0
|
|
#pragma surface surf Unlit keepalpha noshadow noambient novertexlights nolightmap nodynlightmap nodirlightmap nofog nometa noforwardadd
|
|
struct Input
|
|
{
|
|
float4 vertexColor : COLOR;
|
|
float2 uv_texcoord;
|
|
};
|
|
|
|
uniform float _Emissionstr;
|
|
uniform float4 _Color;
|
|
uniform sampler2D _Masktex;
|
|
uniform float4 _Masktex_ST;
|
|
uniform sampler2D _Gridlinetex;
|
|
uniform float4 _Gridlinetex_ST;
|
|
uniform float _Gridlinestr;
|
|
uniform sampler2D _Scantex;
|
|
uniform float _Scanspeed;
|
|
uniform float _Scanstr;
|
|
|
|
inline half4 LightingUnlit( SurfaceOutput s, half3 lightDir, half atten )
|
|
{
|
|
return half4 ( 0, 0, 0, s.Alpha );
|
|
}
|
|
|
|
void surf( Input i , inout SurfaceOutput o )
|
|
{
|
|
float2 uv_Masktex = i.uv_texcoord * _Masktex_ST.xy + _Masktex_ST.zw;
|
|
float2 uv_Gridlinetex = i.uv_texcoord * _Gridlinetex_ST.xy + _Gridlinetex_ST.zw;
|
|
float mulTime8 = _Time.y * _Scanspeed;
|
|
float2 temp_cast_0 = (mulTime8).xx;
|
|
float2 uv_TexCoord6 = i.uv_texcoord + temp_cast_0;
|
|
o.Emission = ( i.vertexColor * _Emissionstr * _Color * ( tex2D( _Masktex, uv_Masktex ).r * ( ( tex2D( _Gridlinetex, uv_Gridlinetex ).r * _Gridlinestr ) * ( tex2D( _Scantex, uv_TexCoord6 ).r * _Scanstr ) ) ) ).rgb;
|
|
o.Alpha = _Color.a;
|
|
}
|
|
|
|
ENDCG
|
|
}
|
|
}
|