aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-10-27 15:58:34 +0200
committerSimon Ser <contact@emersion.fr>2022-10-28 13:49:03 +0200
commitd69018c195d1bb8e6919e73a1709d03a9ae98f38 (patch)
tree186c3b263ec5804adb97906d11b60e92646cdfbb
parenta75f9be2e8c63608ab64b9b93a10fdc25600501b (diff)
render/gles2: move color uniform from quad.vert to quad.frag
We have no use for a v_color varying. We can use the uniform directly from the fragment shader without getting the vertex shader involved.
-rw-r--r--render/gles2/shaders/quad.frag3
-rw-r--r--render/gles2/shaders/quad.vert3
2 files changed, 2 insertions, 4 deletions
diff --git a/render/gles2/shaders/quad.frag b/render/gles2/shaders/quad.frag
index 08291046..f9712797 100644
--- a/render/gles2/shaders/quad.frag
+++ b/render/gles2/shaders/quad.frag
@@ -1,7 +1,8 @@
precision mediump float;
varying vec4 v_color;
varying vec2 v_texcoord;
+uniform vec4 color;
void main() {
- gl_FragColor = v_color;
+ gl_FragColor = color;
}
diff --git a/render/gles2/shaders/quad.vert b/render/gles2/shaders/quad.vert
index abcafd07..9cebb458 100644
--- a/render/gles2/shaders/quad.vert
+++ b/render/gles2/shaders/quad.vert
@@ -1,12 +1,9 @@
uniform mat3 proj;
-uniform vec4 color;
attribute vec2 pos;
attribute vec2 texcoord;
-varying vec4 v_color;
varying vec2 v_texcoord;
void main() {
gl_Position = vec4(proj * vec3(pos, 1.0), 1.0);
- v_color = color;
v_texcoord = texcoord;
}