summaryrefslogtreecommitdiff
path: root/resources/quad.frag
diff options
context:
space:
mode:
author0undefined <oscar@nelin.dk>2025-11-10 23:21:42 +0000
committer0undefined <oscar@nelin.dk>2025-11-10 23:21:42 +0000
commit07442b35158cd7de03315a17694f3f3026207960 (patch)
treeae9571bc4edf620028859274f646e48591e5164d /resources/quad.frag
parentb92c9d17efff6340dad64bd920900a130166ae11 (diff)
Quad & IBO tests
Diffstat (limited to 'resources/quad.frag')
-rw-r--r--resources/quad.frag14
1 files changed, 8 insertions, 6 deletions
diff --git a/resources/quad.frag b/resources/quad.frag
index 3e85ecf..73869cb 100644
--- a/resources/quad.frag
+++ b/resources/quad.frag
@@ -1,13 +1,15 @@
#version 330 core
-in vec3 fragColor;
+in vec2 UV;
-out vec4 color;
+out vec3 color;
-//uniform sampler2D textureSampler;
+uniform sampler2D textureSampler;
void main() {
- color.x = fragColor.x;
- color.y = fragColor.y;
- color.z = fragColor.z;
+ vec3 c = texture(textureSampler, UV).rgb;
+ color = vec3(
+ c.x / 2 + UV.x / 2,
+ c.y / 2 + UV.y / 2,
+ c.z);
}