summaryrefslogtreecommitdiff
path: root/resources
diff options
context:
space:
mode:
Diffstat (limited to 'resources')
-rw-r--r--resources/shader.frag11
-rw-r--r--resources/shader.fragmentshader10
-rw-r--r--resources/shader.vert23
-rw-r--r--resources/shader.vertexshader19
4 files changed, 34 insertions, 29 deletions
diff --git a/resources/shader.frag b/resources/shader.frag
new file mode 100644
index 0000000..f81277d
--- /dev/null
+++ b/resources/shader.frag
@@ -0,0 +1,11 @@
+#version 330 core
+
+// Ouput data
+in vec2 UV;
+out vec3 color;
+
+uniform sampler2D textureSampler;
+
+void main() {
+ color = texture(textureSampler, UV).rgb;
+}
diff --git a/resources/shader.fragmentshader b/resources/shader.fragmentshader
deleted file mode 100644
index a244f24..0000000
--- a/resources/shader.fragmentshader
+++ /dev/null
@@ -1,10 +0,0 @@
-#version 330 core
-
-// Ouput data
-in vec3 fragmentcolor;
-out vec3 color;
-
-void main() {
- color = fragmentcolor;
-
-}
diff --git a/resources/shader.vert b/resources/shader.vert
new file mode 100644
index 0000000..e5aff9a
--- /dev/null
+++ b/resources/shader.vert
@@ -0,0 +1,23 @@
+#version 330 core
+
+// Input vertex data, different for all executions of this shader.
+layout(location = 0) in vec3 vertexPosition_modelspace;
+layout(location = 1) in vec2 vertexUV;
+
+out vec2 UV;
+
+uniform mat4 MVP;
+
+void main() {
+
+ gl_Position = MVP * vec4(vertexPosition_modelspace, 1);
+
+ UV = vertexUV;
+
+ //fragmentcolor.x = vertexPosition_modelspace.x; //= vertexColor;
+ //fragmentcolor.y = vertexPosition_modelspace.y; //= vertexColor;
+ //fragmentcolor.z = vertexPosition_modelspace.z; //= vertexColor;
+
+ //fragmentcolor += 1;
+ //fragmentcolor /= 2;
+}
diff --git a/resources/shader.vertexshader b/resources/shader.vertexshader
deleted file mode 100644
index 55b5250..0000000
--- a/resources/shader.vertexshader
+++ /dev/null
@@ -1,19 +0,0 @@
-#version 330 core
-
-// Input vertex data, different for all executions of this shader.
-layout(location = 0) in vec3 vertexPosition_modelspace;
-layout(location = 1) in vec3 vertexColor;
-
-uniform mat4 MVP;
-
-out vec3 fragmentcolor;
-
-void main() {
-
- gl_Position = MVP * vec4(vertexPosition_modelspace, 1);
- // gl_Position.w = 1.0;
-
- fragmentcolor.r = gl_position.x; //= vertexColor;
- fragmentcolor.g = gl_position.y; //= vertexColor;
- fragmentcolor.b = gl_position.z; //= vertexColor;
-}