-
Notifications
You must be signed in to change notification settings - Fork 22
/
StandardMobile.shader
110 lines (89 loc) · 3.06 KB
/
StandardMobile.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
// Standard shader for mobile
// Written by Nihal Mirpuri @nylonee
Shader "Mobile/Standard"
{
Properties
{
_MainTex("Albedo", 2D) = "white" {}
[Toggle(COLOR_ON)] _ColorToggle("Color, Brightness, Contrast Toggle", Int) = 0
_Color("Color", Color) = (1,1,1)
_Brightness ("Brightness", Range(-10.0, 10.0)) = 0.0
_Contrast ("Contrast", Range(0.0, 3.0)) = 1
[Toggle(PHONG_ON)] _Phong("Point Light Toggle", Int) = 0
_PointLightColor("Point Light Color", Color) = (1,1,1,1)
_PointLightPosition("Point Light Position", Vector) = (0.0,0.0,0.0)
_AmbiencePower("Ambience intensity", Range(0.0,2.0)) = 1.0
_SpecularPower("Specular intensity", Range(0.0,2.0)) = 1.0
_DiffusePower("Diffuse intensity", Range(0.0,2.0)) = 1.0
[Toggle(DETAIL_ON)] _Detail("Detail Map Toggle", Int) = 0
_DetailMap("Detail Map", 2D) = "white" {}
_DetailStrength("Detail Map Strength", Range(0.0, 2.0)) = 1
[Toggle(DETAIL_MASK_ON)] _Mask("Detail Mask Toggle", Int) = 0
_DetailMask("Detail Mask", 2D) = "white" {}
[Toggle(EMISSION_ON)] _Emission("Emission Map Toggle", Int) = 0
_EmissionMap("Emission", 2D) = "white" {}
_EmissionStrength("Emission Strength", Range(0.0,10.0)) = 1
[Toggle(NORMAL_ON)] _Normal("Normal Map Toggle", Int) = 0
_NormalMap("Normal Map", 2D) = "bump" {}
}
SubShader {
Tags { "RenderType" = "Opaque" }
LOD 150
// Render the relevant pass based on whether lightmap data is being passed in
Pass {
Tags { "LightMode" = "VertexLM" }
Lighting Off
Cull Back
CGPROGRAM
#pragma vertex vert_lm
#pragma fragment frag_lm
#pragma multi_compile_fog
#pragma skip_variants FOG_LINEAR FOG_EXP
#pragma shader_feature COLOR_ON
#pragma shader_feature PHONG_ON
#pragma shader_feature DETAIL_ON
#pragma shader_feature DETAIL_MASK_ON
#pragma shader_feature EMISSION_ON
#pragma shader_feature NORMAL_ON
#include "StandardMobile.cginc"
ENDCG
}
Pass {
Tags { "LightMode" = "VertexLMRGBM" }
Lighting Off
Cull Back
CGPROGRAM
#pragma vertex vert_lm
#pragma fragment frag_lm
#pragma multi_compile_fog
#pragma skip_variants FOG_LINEAR FOG_EXP
#pragma shader_feature COLOR_ON
#pragma shader_feature PHONG_ON
#pragma shader_feature DETAIL_ON
#pragma shader_feature DETAIL_MASK_ON
#pragma shader_feature EMISSION_ON
#pragma shader_feature NORMAL_ON
#include "StandardMobile.cginc"
ENDCG
}
Pass {
Tags { "LightMode" = "Vertex" }
Lighting Off
Cull Back
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_fog
#pragma skip_variants FOG_LINEAR FOG_EXP
#pragma shader_feature COLOR_ON
#pragma shader_feature PHONG_ON
#pragma shader_feature DETAIL_ON
#pragma shader_feature DETAIL_MASK_ON
#pragma shader_feature EMISSION_ON
#pragma shader_feature NORMAL_ON
#include "StandardMobile.cginc"
ENDCG
}
}
FallBack "Mobile/VertexLit"
}