主要变更: 1. 新增多风格音效资源与管理文档 2. 修复翻译服务空响应处理与Dio日志异常捕获 3. 完善Web端平台适配与路径获取Stub 4. 优化设备配对与文件传输功能 5. 新增角色命名常量与摇一摇检测器 6. 修复Riverpod dispose与鸿蒙导航路由 7. 新增每日通知服务与流体着色器 8. 优化备份服务与数据管理页面 9. 新增隐私设置附近设备发现选项 10. 重构诗词提供者支持历史记录 11. 完善桌面端构建配置与开发脚本 12. 清理旧版工具部署脚本
50 lines
1.3 KiB
GLSL
50 lines
1.3 KiB
GLSL
#include <flutter/runtime_effect.glsl>
|
|
|
|
uniform float u_time;
|
|
uniform vec2 u_resolution;
|
|
uniform vec2 u_touch;
|
|
|
|
out vec4 fragColor;
|
|
|
|
float random(vec2 st) {
|
|
return fract(sin(dot(st.xy, vec2(12.9898, 78.233))) * 43758.5453123);
|
|
}
|
|
|
|
float noise(vec2 st) {
|
|
vec2 i = floor(st);
|
|
vec2 f = fract(st);
|
|
float a = random(i);
|
|
float b = random(i + vec2(1.0, 0.0));
|
|
float c = random(i + vec2(0.0, 1.0));
|
|
float d = random(i + vec2(1.0, 1.0));
|
|
vec2 u = f * f * (3.0 - 2.0 * f);
|
|
return mix(a, b, u.x) + (c - a) * u.y * (1.0 - u.x) + (d - b) * u.x * u.y;
|
|
}
|
|
|
|
void main() {
|
|
vec2 st = FlutterFragCoord().xy / u_resolution;
|
|
st.x *= u_resolution.x / u_resolution.y;
|
|
|
|
float t = u_time * 0.3;
|
|
|
|
float n = noise(st * 3.0 + t);
|
|
n += 0.5 * noise(st * 6.0 - t * 0.7);
|
|
n += 0.25 * noise(st * 12.0 + t * 0.5);
|
|
|
|
if (u_touch.x > 0.0 && u_touch.y > 0.0) {
|
|
vec2 touchPos = u_touch / u_resolution;
|
|
touchPos.x *= u_resolution.x / u_resolution.y;
|
|
float dist = distance(st, touchPos);
|
|
n += 0.3 * smoothstep(0.3, 0.0, dist) * sin(dist * 20.0 - u_time * 3.0);
|
|
}
|
|
|
|
vec3 color1 = vec3(0.4, 0.6, 0.9);
|
|
vec3 color2 = vec3(0.7, 0.4, 0.8);
|
|
vec3 color3 = vec3(0.3, 0.8, 0.7);
|
|
|
|
vec3 color = mix(color1, color2, n);
|
|
color = mix(color, color3, n * 0.5);
|
|
|
|
fragColor = vec4(color, 0.6);
|
|
}
|