fixed gles bugs

This commit is contained in:
itsmattkc
2018-11-16 09:45:18 +11:00
parent b264680159
commit 55e1ea4fe9
5 changed files with 19 additions and 15 deletions
+3 -2
View File
@@ -1,6 +1,7 @@
#version 120
uniform sampler2D tex0;
varying vec4 vTexCoord;
varying vec2 vTexCoord;
const float PI = 3.1415926535;
uniform vec2 resolution;
@@ -19,7 +20,7 @@ vec2 distort(vec2 p, vec2 offset) {
void main(void) {
vec2 offset = vec2(xoff/resolution.x, yoff/resolution.y);
vec2 xy = 2.0 * vTexCoord.xy - 1.0 - offset;
vec2 xy = 2.0 * vTexCoord - 1.0 - offset;
vec2 uv;
float d = length(xy);
uv = distort(xy, offset);
+3 -3
View File
@@ -1,6 +1,6 @@
#version 120
uniform sampler2D tex0;
varying vec4 vTexCoord;
varying vec2 vTexCoord;
#define M_PI 3.1415926535897932384626433832795
uniform float size;
@@ -9,7 +9,7 @@ void main(void) {
float maxFactor = 2.0 - (size * 0.01);
vec2 uv;
vec2 xy = 2.0 * vTexCoord.xy - 1.0;
vec2 xy = 2.0 * vTexCoord - 1.0;
float d = length(xy);
if (d < (2.0-maxFactor)) {
d = length(xy * maxFactor);
@@ -20,7 +20,7 @@ void main(void) {
uv.x = r * cos(phi) + 0.5;
uv.y = r * sin(phi) + 0.5;
} else {
uv = vTexCoord.xy;
uv = vTexCoord;
}
vec4 c = texture2D(tex0, uv);
gl_FragColor = c;
+1 -1
View File
@@ -1,6 +1,6 @@
#version 150
uniform sampler2D tex0;
in vec4 vTexCoord;
in vec2 vTexCoord;
out vec4 FragColor;
uniform float colors; // 12.0