summaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2023-08-15 17:01:01 -0400
committerJonathan Bradley <jcb@pikum.xyz>2023-08-15 17:01:01 -0400
commit90ae5cdba22681488f2cb638e8abedaebbd29be1 (patch)
tree562c8964c1a1be5c0e2552fdc5606a10e87c4dbf /assets
parentaf5d06a391aafd0c5a24cf15eeaeddbb9b4f8182 (diff)
add shaders
Diffstat (limited to 'assets')
-rw-r--r--assets/shaders/present.frag16
-rw-r--r--assets/shaders/present.vert14
2 files changed, 30 insertions, 0 deletions
diff --git a/assets/shaders/present.frag b/assets/shaders/present.frag
new file mode 100644
index 0000000..695f7bd
--- /dev/null
+++ b/assets/shaders/present.frag
@@ -0,0 +1,16 @@
+#version 450
+
+layout (binding = 0) uniform sampler2D samplerColor;
+
+layout (location = 0) in vec2 inUV;
+
+layout (location = 0) out vec4 outFragColor;
+
+void main()
+{
+ vec4 color = texture(samplerColor, inUV);
+ if (color.w == 0) {
+ discard;
+ }
+ outFragColor = color;
+} \ No newline at end of file
diff --git a/assets/shaders/present.vert b/assets/shaders/present.vert
new file mode 100644
index 0000000..5423fcf
--- /dev/null
+++ b/assets/shaders/present.vert
@@ -0,0 +1,14 @@
+#version 450
+
+layout (location = 0) out vec2 outUV;
+
+out gl_PerVertex
+{
+ vec4 gl_Position;
+};
+
+void main()
+{
+ outUV = vec2((gl_VertexIndex << 1) & 2, gl_VertexIndex & 2);
+ gl_Position = vec4(outUV * 2.0f - 1.0f, 0.0f, 1.0f);
+} \ No newline at end of file