ShaderArt实现多彩阴影方块渐变艺术动画效果代码
代码语言:html
所属分类:动画
代码描述:ShaderArt实现多彩阴影方块渐变艺术动画效果代码
代码标签: ShaderArt 多彩 阴影 方块 渐变 艺术 动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> body { display: flex; margin:0; height: 100vh; } shader-art { display: block; width: 100%; height: 100%; } shader-art canvas { display: block; width: 100%; height: 100%; } </style> </head> <body > <shader-art autoplay> <script type="buffer" name="position" data-size="2"> [-1, 1, -1,-1, 1,1, 1, 1, -1,-1, 1,-1] </script> <script type="buffer" name="uv" data-size="2"> [ 0, 0, 0, 1, 1,0, 1, 0, 0, 1, 1, 1] </script> <script type="vert"> precision highp float; attribute vec4 position; attribute vec2 uv; varying vec2 vUv; void main() { vUv = uv; gl_Position = position; } </script> <script type="frag"> precision highp float; varying vec2 vUv; uniform vec2 resolution; uniform float time; #define PI 3.141592654 void main() { float.........完整代码请登录后点击上方下载按钮下载查看
网友评论0