feat(all): 迁移扩展相关功能

This commit is contained in:
plum
2026-04-08 15:34:43 +08:00
parent ad2dd979eb
commit d7c0dba569
278 changed files with 25207 additions and 62 deletions
@@ -0,0 +1,34 @@
precision highp float;
precision highp int;
uniform sampler2D tInput;
uniform vec2 delta;
in vec2 coord;
out vec4 fragColor;
void main() {
/* get vertex info */
vec4 info = texture(tInput, coord);
/* calculate average neighbor height */
vec2 dx = vec2(delta.x, 0.0);
vec2 dy = vec2(0.0, delta.y);
float average = (
texture(tInput, coord - dx).r +
texture(tInput, coord - dy).r +
texture(tInput, coord + dx).r +
texture(tInput, coord + dy).r
) * 0.25;
/* change the velocity to move toward the average */
info.g += (average - info.r) * 2.0;
/* attenuate the velocity a little so waves do not last forever */
info.g *= 0.995;
/* move the vertex along the velocity */
info.r += info.g;
fragColor = info;
}