Select Git revision
RainShader.shader
RainShader.shader 4.40 KiB
//
// Rain Maker (c) 2015 Digital Ruby, LLC
// http://www.digitalruby.com
//
Shader "Custom/RainShader"
{
Properties
{
_MainTex ("Color (RGB) Alpha (A)", 2D) = "gray" {}
_TintColor ("Tint Color (RGB)", Color) = (1, 1, 1, 1)
_PointSpotLightMultiplier ("Point/Spot Light Multiplier", Range (0, 10)) = 2
_DirectionalLightMultiplier ("Directional Light Multiplier", Range (0, 10)) = 1
_InvFade ("Soft Particles Factor", Range(0.01, 100.0)) = 1.0
_AmbientLightMultiplier ("Ambient light multiplier", Range(0, 1)) = 0.25
}
SubShader
{
Tags { "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" "RenderType"="Transparent" "LightMode"="Vertex" }
LOD 100
Pass
{
ZWrite Off
Cull Back
Lighting On
AlphaTest Greater 0.01
ColorMask RGB
Blend SrcAlpha OneMinusSrcAlpha
CGPROGRAM
#pragma multi_compile_particles
#pragma vertex vert
#pragma fragment frag
#pragma fragmentoption ARB_precision_hint_fastest
#include "UnityCG.cginc"
#include "Lighting.cginc"
fixed4 _TintColor;
float _DirectionalLightMultiplier;
float _PointSpotLightMultiplier;
float _AmbientLightMultiplier;
#if defined(SOFTPARTICLES_ON)
float _InvFade;
#endif
struct appdata_t
{
float4 vertex : POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
};
struct v2f
{
half2 uv_MainTex : TEXCOORD0;
fixed4 color : COLOR0;
float4 pos : SV_POSITION;
#if defined(SOFTPARTICLES_ON)
float4 projPos : TEXCOORD1;
#endif
};
float3 ApplyLight(int index, float3 lightColor, float3 viewPos)
{
fixed3 currentLightColor = unity_LightColor[index].rgb;