mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-09-27 20:48:53 +02:00
wlbg: don't use deprecated functions in shaders
This commit is contained in:
parent
f9a691e573
commit
4ec3a2fccc
4 changed files with 9 additions and 5 deletions
|
@ -6,6 +6,8 @@ uniform float time;
|
||||||
|
|
||||||
in vec2 fragCoord;
|
in vec2 fragCoord;
|
||||||
|
|
||||||
|
out vec4 fragColor;
|
||||||
|
|
||||||
// shader: https://www.shadertoy.com/view/Ms2SDc
|
// shader: https://www.shadertoy.com/view/Ms2SDc
|
||||||
|
|
||||||
const float PI=3.14159265358979323846;
|
const float PI=3.14159265358979323846;
|
||||||
|
@ -62,5 +64,5 @@ void main() {
|
||||||
float c=(n.x+n.y+n.z)*0.1;
|
float c=(n.x+n.y+n.z)*0.1;
|
||||||
vec3 color=vec3(c,c,c)-t*0.0625;
|
vec3 color=vec3(c,c,c)-t*0.0625;
|
||||||
//color*=0.6+0.4*rand(vec2(t,t),iTime); // noise!
|
//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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ precision mediump float;
|
||||||
|
|
||||||
uniform vec2 offset;
|
uniform vec2 offset;
|
||||||
|
|
||||||
attribute vec4 vPos;
|
in vec4 vPos;
|
||||||
|
|
||||||
out vec2 fragCoord;
|
out vec2 fragCoord;
|
||||||
|
|
||||||
|
|
|
@ -10,11 +10,13 @@ uniform float hasCursor;
|
||||||
in vec2 fragCoord;
|
in vec2 fragCoord;
|
||||||
in vec2 fragUv;
|
in vec2 fragUv;
|
||||||
|
|
||||||
|
out vec4 fragColor;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
vec2 diff = cursorPos - fragUv;
|
vec2 diff = cursorPos - fragUv;
|
||||||
float light = clamp(.1 - (diff.x * diff.x + diff.y * diff.y), 0.0, 1.0);
|
float light = clamp(.1 - (diff.x * diff.x + diff.y * diff.y), 0.0, 1.0);
|
||||||
|
|
||||||
vec2 zoomedUv = fragUv * .9 + (.1 / 2.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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
precision mediump float;
|
precision mediump float;
|
||||||
|
|
||||||
attribute vec4 vPos;
|
in vec4 vPos;
|
||||||
attribute vec2 uv;
|
in vec2 uv;
|
||||||
|
|
||||||
out vec2 fragCoord;
|
out vec2 fragCoord;
|
||||||
out vec2 fragUv;
|
out vec2 fragUv;
|
||||||
|
|
Loading…
Reference in a new issue