summaryrefslogtreecommitdiff
path: root/themes/src/_shaders
diff options
context:
space:
mode:
authormattkae <mattkae@protonmail.com>2023-08-13 16:02:22 -0400
committermattkae <mattkae@protonmail.com>2023-08-13 16:02:22 -0400
commit056d4560f72a9ec281f8df31aa2a7d8241d6adf1 (patch)
treed0bcbe3ad5dd9e4efb662389b1aa6806cc4365ef /themes/src/_shaders
parentb6a666e96ffd04bd6d52be8fd9899faf27b751db (diff)
Generating a cpp file for shaders
Diffstat (limited to 'themes/src/_shaders')
-rw-r--r--themes/src/_shaders/renderer2d.frag5
-rw-r--r--themes/src/_shaders/renderer2d.vert13
2 files changed, 18 insertions, 0 deletions
diff --git a/themes/src/_shaders/renderer2d.frag b/themes/src/_shaders/renderer2d.frag
index e69de29..8463e06 100644
--- a/themes/src/_shaders/renderer2d.frag
+++ b/themes/src/_shaders/renderer2d.frag
@@ -0,0 +1,5 @@
+varying lowp vec4 VertexColor;
+
+void main() {
+ gl_FragColor = VertexColor;
+}
diff --git a/themes/src/_shaders/renderer2d.vert b/themes/src/_shaders/renderer2d.vert
index e69de29..76150f0 100644
--- a/themes/src/_shaders/renderer2d.vert
+++ b/themes/src/_shaders/renderer2d.vert
@@ -0,0 +1,13 @@
+
+attribute vec2 position;
+attribute vec4 color;
+attribute mat4 vMatrix;
+uniform mat4 projection;
+uniform mat4 model;
+varying lowp vec4 VertexColor;
+
+void main() {
+ vec4 fragmentPosition = projection * model * vMatrix * vec4(position.x, position.y, 0, 1);
+ gl_Position = fragmentPosition;
+ VertexColor = color;
+}