-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathStandardGeometry.shader
61 lines (53 loc) · 1.74 KB
/
StandardGeometry.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
// Standard geometry shader example
// https://github.com/keijiro/StandardGeometryShader
Shader "Standard Geometry Shader Example"
{
Properties
{
_Color("Color", Color) = (1, 1, 1, 1)
_MainTex("Albedo", 2D) = "white" {}
[Space]
_Glossiness("Smoothness", Range(0, 1)) = 0.5
[Gamma] _Metallic("Metallic", Range(0, 1)) = 0
[Space]
_BumpMap("Normal Map", 2D) = "bump" {}
_BumpScale("Scale", Float) = 1
[Space]
_OcclusionMap("Occlusion Map", 2D) = "white" {}
_OcclusionStrength("Strength", Range(0, 1)) = 1
[Space]
_LocalTime("Animation Time", Float) = 0.0
}
SubShader
{
Tags { "RenderType"="Opaque" }
// This shader only implements the deferred rendering pass (GBuffer
// construction) and the shadow caster pass, so that it doesn't
// support forward rendering.
Pass
{
Tags { "LightMode"="Deferred" }
CGPROGRAM
#pragma target 4.0
#pragma vertex Vertex
#pragma geometry Geometry
#pragma fragment Fragment
#pragma multi_compile_prepassfinal noshadowmask nodynlightmap nodirlightmap nolightmap
#include "StandardGeometry.cginc"
ENDCG
}
Pass
{
Tags { "LightMode"="ShadowCaster" }
CGPROGRAM
#pragma target 4.0
#pragma vertex Vertex
#pragma geometry Geometry
#pragma fragment Fragment
#pragma multi_compile_shadowcaster noshadowmask nodynlightmap nodirlightmap nolightmap
#define UNITY_PASS_SHADOWCASTER
#include "StandardGeometry.cginc"
ENDCG
}
}
}