shader-doodle实现波纹效果
代码语言:html
所属分类:动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title> </title> <style> body { margin: 0; background: black; } shader-doodle { display: block; width: 100vw; height: 100vh; position: fixed; top: 50%; left: 50%; -webkit-transform: translate3d(-50%, -50%, 0); transform: translate3d(-50%, -50%, 0); } </style> </head> <body translate="no"> <shader-doodle> <script type="x-shader/x-fragment"> const float PI = 3.14159265359; void main() { vec2 uv = (gl_FragCoord.xy - 0.5 * u_resolution.xy) / u_resolution.y * 2.0; vec3 color = vec3(0); float t = mod(u_time + sin(-uv.y * 3.0 * uv.x * 8.0 + u_time * 3.0), 2.0) /.........完整代码请登录后点击上方下载按钮下载查看
网友评论0