Skip to content

Commit 2f8babb

Browse files
committed
Add Composite2.shader
1 parent c1118fd commit 2f8babb

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
Shader "Hidden/Composite2"
2+
{
3+
Properties
4+
{
5+
_MainTex ("Texture", 2D) = "white" {}
6+
}
7+
SubShader
8+
{
9+
// No culling or depth
10+
Cull Off ZWrite Off ZTest Always
11+
12+
Pass
13+
{
14+
CGPROGRAM
15+
#pragma vertex vert
16+
#pragma fragment frag
17+
18+
#include "UnityCG.cginc"
19+
20+
struct appdata
21+
{
22+
float4 vertex : POSITION;
23+
float2 uv : TEXCOORD0;
24+
};
25+
26+
struct v2f
27+
{
28+
float2 uv : TEXCOORD0;
29+
float4 vertex : SV_POSITION;
30+
};
31+
32+
v2f vert (appdata v)
33+
{
34+
v2f o;
35+
o.vertex = UnityObjectToClipPos(v.vertex);
36+
o.uv = v.uv;
37+
return o;
38+
}
39+
40+
sampler2D _MainTex;
41+
42+
fixed4 frag (v2f i) : SV_Target
43+
{
44+
fixed4 col = tex2D(_MainTex, i.uv);
45+
// just invert the colors
46+
col.rgb = 1 - col.rgb;
47+
return col;
48+
}
49+
ENDCG
50+
}
51+
}
52+
}

Assets/Demoscene/Projects/2018-07-28-Composite/Composite2.shader.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)