-
Notifications
You must be signed in to change notification settings - Fork 0
/
LightFX.shader
49 lines (46 loc) · 1.67 KB
/
LightFX.shader
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Shader "LightFX/LightFX"
{
Properties
{
_Color("Color", Color) = (1,1,1,1)
_MainTex ("Texture", 2D) = "white" {}
[Normal] [NoScaleOffset] _Normals("Normal Map (Common Light/Dark)", 2D) = "bump" {}
[NoScaleOffset] _Gloss("Metallic-Smoothness", 2D) = "black" {}
_MinLight("Minimum lighting", Range(0, 1)) = 0.2
[NoScaleOffset] _Emissions("Emission Map", 2D) = "white" {}
_EmissionColor ("Emission Color", Color) = (1,1,1,1)
_EmissionIntensity ("Emission Intensity", Range(0, 10)) = 1
[Space(50)] [Header(Darkness Texture)] [Space]
_DarknessStart ("Darkness Start", Range(0, 1)) = 0.2
_DarknessEnd ("Darkness End", Range(0, 1)) = 0.25
[NoScaleOffset] _DarkTex("Dark Texture", 2D) = "white" {}
[NoScaleOffset] _DarkGloss("Dark Metallic-Smoothness", 2D) = "black" {}
[NoScaleOffset] _DarkEmissions("Dark Emission Map", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" }
// Base pass
Pass {
Tags { "LightMode" = "ForwardBase" }
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#define IS_IN_BASE_PASS
#include "LightFX.cginc"
ENDCG
}
// Add pass
GrabPass { "_PrevBuffer" }
Pass {
Tags { "LightMode" = "ForwardAdd" }
Blend One Zero // src*1 + dst*0
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_fwdadd
#include "LightFX.cginc"
ENDCG
}
}
}