-
Notifications
You must be signed in to change notification settings - Fork 0
/
CurvedLit.shader
110 lines (107 loc) · 3.28 KB
/
CurvedLit.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
Shader "A3/CurvedLit"
{
Properties
{
[Enum(UnityEngine.Rendering.CullMode)] _Cull("Culling", Int) = 2
_MainTex("MainTex", 2D) = "white" {}
_Color("Color", Color) = (1,1,1,1)
[Space]
_Shadow("Shadow", Range(0, 1)) = 0.4
_ShadowMag("Shadow Mag", Range(0, 10)) = 2.0
_ShadowOffset("Shadow Offset", Range(-10, 10)) = -0.5
[Toggle(_USE_INDIRECTLIGHTING)]
_UseIndirectlighting("Use Indirectlighting", Float) = 1
[Toggle(_USE_REFLECTION)]
_UseReflection("Use Reflection", Float) = 1
_ReflectionPower("Reflection Power", Range(0, 10)) = 7
_Reflection("Reflection", Range(0, 1)) = 0.02
[Space]
[Toggle(_USE_EMISSION)]
_UseEmission("Use Emission", Float) = 0
_EmissionMap("Emission Map", 2D) = "white" {}
[HDR]_EmissionColor("Emission Color", Color) = (0,0,0,1)
[Space]
[Toggle(_USE_NORMALMAP)]
_UseNormalmap("Use Normal Map", Float) = 0
_NormalMap("Normal Map", 2D) = "bump" {}
_Cutoff("Alpha Cutoff", Range(0,1)) = 0.5
[Space]
[Toggle(_USE_HIGHLIGHT)]
_UseHighLight("Use HighLight", Float) = 0
_HighLightColor( "HighLight Color", Color ) = ( 1.0, 1.0, 1.0, 1.0 )
_HighLightPower( "HighLight Power", Range( 0, 10.0 )) = 7.0
_HighLightMag( "HighLight Mag", Range( 0, 1.0 )) = 0.5
_HighLightTex ("HighLight Tex", 2D) = "white" {}
[Space]
[Toggle(_USE_HAIRLIGHT)]
_UseHairLight("Use HairLight", Float) = 0
_HairLightColor( "HairLight Color", Color ) = ( 1.0, 1.0, 1.0, 1.0 )
_HairLightTex ("HairLight Tex", 2D) = "white" {}
[Space]
[Toggle(_USE_RIM)]
_UseRim("Use Rim", Float) = 0
_RimColor( "Rim Color", Color ) = ( 1.0, 1.0, 1.0, 1.0 )
_RimPower( "Rim Power", Range( 0, 10.0 )) = 3.0
_RimLightTex ("Rim Tex", 2D) = "white" {}
[Space]
// Blending state
_Mode ("__mode", Float) = 0.0
[Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend ("__src", Float) = 1.0
[Enum(UnityEngine.Rendering.BlendMode)] _DstBlend ("__dst", Float) = 0.0
_ZWrite ("__zw", Float) = 1.0
}
SubShader
{
Tags
{
"RenderType" = "Opaque"
}
Pass
{
Name "FORWARD"
Tags { "LightMode" = "ForwardBase" }
Blend [_SrcBlend] [_DstBlend]
ZWrite [_ZWrite]
Cull [_Cull]
CGPROGRAM
#pragma shader_feature _USE_NORMALMAP
#pragma shader_feature _USE_REFLECTION
#pragma shader_feature _USE_INDIRECTLIGHTING
#pragma shader_feature _USE_EMISSION
#pragma shader_feature _USE_RIM
#pragma shader_feature _USE_HIGHLIGHT
#pragma shader_feature _USE_HAIRLIGHT
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
#include "CurvedLitCore.cginc"
#pragma vertex vert
#pragma fragment frag
#pragma only_renderers d3d11 glcore gles
#pragma target 4.0
#pragma multi_compile_fwdbase
#pragma multi_compile_fog
ENDCG
}
Pass
{
Name "FORWARD_DELTA"
Tags { "LightMode" = "ForwardAdd" }
Blend [_SrcBlend] One
Cull [_Cull]
CGPROGRAM
#define _PASS_FORWARDADD
#pragma shader_feature _USE_NORMALMAP
#pragma shader_feature _USE_HIGHLIGHT
#pragma shader_feature _USE_RIM
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
#include "CurvedLitCore.cginc"
#pragma vertex vert
#pragma fragment frag
#pragma only_renderers d3d11 glcore gles
#pragma target 4.0
#pragma multi_compile_fwdadd_fullshadows
#pragma multi_compile_fog
ENDCG
}
}
FallBack "Diffuse"
}