aboutsummaryrefslogtreecommitdiff
path: root/resources
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2020-07-05 18:55:39 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2020-07-05 18:55:39 +0200
commite29a9115d185d0b752868a36c8d56f6020bc4134 (patch)
treed7d267d8578637714581f6758887945ae19fc15b /resources
parent0d0652bbc07bc073ba1efabe865552d96c10104c (diff)
Create basics source files
Diffstat (limited to 'resources')
-rw-r--r--resources/shaders/square.glsl29
1 files changed, 29 insertions, 0 deletions
diff --git a/resources/shaders/square.glsl b/resources/shaders/square.glsl
new file mode 100644
index 0000000..200215c
--- /dev/null
+++ b/resources/shaders/square.glsl
@@ -0,0 +1,29 @@
+// ----- Vertex Shader -----
+#version 330 core
+
+layout(location = 0) in vec3 position;
+uniform mat4 projection;
+uniform mat4 model;
+
+
+void main(){
+
+ gl_Position = projection * model * vec4(position,1);
+
+}
+
+// ----- Fragment Shader -----
+
+#version 330 core
+
+uniform vec2 resolution;
+uniform float time;
+
+out vec3 color;
+
+void main(){
+ vec2 coord=gl_FragCoord.xy/resolution;
+ coord-=0.5;
+ float d=length(coord);
+ color=vec3(d,1,1);
+}