-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathWireframe Overlay.shader
69 lines (65 loc) · 2.14 KB
/
Wireframe Overlay.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
Shader "Okano/Wireframe Overlay/Diffuse Color" {
Properties {
_BaseColor ("Base Color", Color) = (0.0, 0.0, 0.0, 0.0)
_WireframeDrawDistance ("Fade Distance", float) = 1.7
_Rainbow ("Wireframe Texture", 2D) = "white" {}
_Speed ("Wireframe Texture Speed", Float ) = 0.1
_WireThickness ("Wire Thickness", RANGE(0, 800)) = 300
_WireSmoothness ("Wire Intensity", RANGE(0, 20)) = 20
_MaxTriSize ("Max Tri Size", RANGE(0, 200)) = 25
}
SubShader {
Tags {
"RenderType"="Opaque"
}
Pass
{
Name "Wireframe"
Cull Off
CGPROGRAM
#pragma vertex vert
#pragma geometry geom
#pragma fragment frag
#include "UnityCG.cginc"
#include "Libraries/Wireframe.cginc"//
ENDCG
}
Pass {
Name "ShadowCaster"
Tags {
"LightMode"="ShadowCaster"
}
Offset 1, 1
Cull Off
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#define UNITY_PASS_SHADOWCASTER
#include "UnityCG.cginc"
#include "Lighting.cginc"
#pragma fragmentoption ARB_precision_hint_fastest
#pragma multi_compile_shadowcaster
#pragma only_renderers d3d9 d3d11 glcore gles
#pragma target 3.0
struct VertexInput {
float4 vertex : POSITION;
};
struct VertexOutput {
V2F_SHADOW_CASTER;
};
VertexOutput vert (VertexInput v) {
VertexOutput o = (VertexOutput)0;
o.pos = UnityObjectToClipPos( v.vertex );
TRANSFER_SHADOW_CASTER(o)
return o;
}
float4 frag(VertexOutput i, float facing : VFACE) : COLOR {
float isFrontFace = ( facing >= 0 ? 1 : 0 );
float faceSign = ( facing >= 0 ? 1 : -1 );
SHADOW_CASTER_FRAGMENT(i)
}
ENDCG
}
}
FallBack "Diffuse"
}