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.
parent
a75f9be2e8
commit
d69018c195
@ -1,7 +1,8 @@
|
|||||||
precision mediump float;
|
precision mediump float;
|
||||||
varying vec4 v_color;
|
varying vec4 v_color;
|
||||||
varying vec2 v_texcoord;
|
varying vec2 v_texcoord;
|
||||||
|
uniform vec4 color;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
gl_FragColor = v_color;
|
gl_FragColor = color;
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
uniform mat3 proj;
|
uniform mat3 proj;
|
||||||
uniform vec4 color;
|
|
||||||
attribute vec2 pos;
|
attribute vec2 pos;
|
||||||
attribute vec2 texcoord;
|
attribute vec2 texcoord;
|
||||||
varying vec4 v_color;
|
|
||||||
varying vec2 v_texcoord;
|
varying vec2 v_texcoord;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
gl_Position = vec4(proj * vec3(pos, 1.0), 1.0);
|
gl_Position = vec4(proj * vec3(pos, 1.0), 1.0);
|
||||||
v_color = color;
|
|
||||||
v_texcoord = texcoord;
|
v_texcoord = texcoord;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in new issue