stuff
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
|
||||
varying vec4 v_TexCoord;
|
||||
varying vec2 v_Direction;
|
||||
|
||||
uniform sampler2D g_Texture0; // {"material":"Framebuffer","hidden":true}
|
||||
uniform sampler2D g_Texture1; // {"material":"Mask","mode":"opacitymask","default":"util/white"}
|
||||
uniform float g_Time;
|
||||
|
||||
uniform float g_Speed; // {"material":"Speed","default":5,"range":[0.01,50]}
|
||||
uniform float g_Scale; // {"material":"Scale","default":200,"range":[0.01,1000]}
|
||||
uniform float g_Strength; // {"material":"Strength","default":0.1,"range":[0.01,1]}
|
||||
|
||||
void main() {
|
||||
float mask = texSample2D(g_Texture1, v_TexCoord.zw).r;
|
||||
vec2 texCoord = v_TexCoord.xy;
|
||||
|
||||
float distance = g_Time * g_Speed + dot(texCoord, v_Direction) * g_Scale;
|
||||
vec2 offset = vec2(v_Direction.y, -v_Direction.x);
|
||||
texCoord += sin(distance) * offset * g_Strength * g_Strength * mask;
|
||||
|
||||
gl_FragColor = texSample2D(g_Texture0, texCoord);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
#include "common.h"
|
||||
|
||||
uniform mat4 g_ModelViewProjectionMatrix;
|
||||
uniform float g_Time;
|
||||
uniform vec4 g_Texture1Resolution;
|
||||
uniform float g_Direction; // {"material":"Direction","default":0,"range":[0,6.28]}
|
||||
|
||||
attribute vec3 a_Position;
|
||||
attribute vec2 a_TexCoord;
|
||||
|
||||
varying vec4 v_TexCoord;
|
||||
varying vec2 v_Direction;
|
||||
|
||||
void main() {
|
||||
gl_Position = mul(vec4(a_Position, 1.0), g_ModelViewProjectionMatrix);
|
||||
v_TexCoord.xy = a_TexCoord;
|
||||
|
||||
v_TexCoord.zw = vec2(v_TexCoord.x * g_Texture1Resolution.z / g_Texture1Resolution.x,
|
||||
v_TexCoord.y * g_Texture1Resolution.w / g_Texture1Resolution.y);
|
||||
|
||||
v_Direction = rotateVec2(vec2(0, -1), g_Direction);
|
||||
}
|
||||
Reference in New Issue
Block a user