wlbg: don't use deprecated functions in shaders

This commit is contained in:
LordMZTE 2023-11-02 07:06:32 +01:00
parent f9a691e573
commit 4ec3a2fccc
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6
4 changed files with 9 additions and 5 deletions

View file

@ -6,6 +6,8 @@ uniform float time;
in vec2 fragCoord;
out vec4 fragColor;
// shader: https://www.shadertoy.com/view/Ms2SDc
const float PI=3.14159265358979323846;
@ -62,5 +64,5 @@ void main() {
float c=(n.x+n.y+n.z)*0.1;
vec3 color=vec3(c,c,c)-t*0.0625;
//color*=0.6+0.4*rand(vec2(t,t),iTime); // noise!
gl_FragColor=vec4(vec3(c+t*0.08,c+t*0.02,c*1.5-t*0.01)+color*color,1.0);
fragColor=vec4(vec3(c+t*0.08,c+t*0.02,c*1.5-t*0.01)+color*color,1.0);
}

View file

@ -4,7 +4,7 @@ precision mediump float;
uniform vec2 offset;
attribute vec4 vPos;
in vec4 vPos;
out vec2 fragCoord;

View file

@ -10,11 +10,13 @@ uniform float hasCursor;
in vec2 fragCoord;
in vec2 fragUv;
out vec4 fragColor;
void main() {
vec2 diff = cursorPos - fragUv;
float light = clamp(.1 - (diff.x * diff.x + diff.y * diff.y), 0.0, 1.0);
vec2 zoomedUv = fragUv * .9 + (.1 / 2.0);
gl_FragColor = mix(texture(bg, zoomedUv + (cursorPos - .5) / 10.0), vec4(1.0), light * hasCursor);
fragColor = mix(texture(bg, zoomedUv + (cursorPos - .5) / 10.0), vec4(1.0), light * hasCursor);
}

View file

@ -2,8 +2,8 @@
precision mediump float;
attribute vec4 vPos;
attribute vec2 uv;
in vec4 vPos;
in vec2 uv;
out vec2 fragCoord;
out vec2 fragUv;