curtains实现webgl多彩渐变动画背景效果代码
代码语言:html
所属分类:背景
代码描述:curtains实现webgl多彩渐变动画背景效果代码
代码标签: curtains webgl 多彩 渐变 动画 背景
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> #plane { position: absolute; inset: 0; } </style> </head> <body > <script type="x-shader/x-vertex" id="vs"> precision mediump float; // those are the mandatory attributes that the lib sets attribute vec3 aVertexPosition; attribute vec2 aTextureCoord; // those are mandatory uniforms that the lib sets and that contain our model view and projection matrix uniform mat4 uMVMatrix; uniform mat4 uPMatrix; // our texture matrix that will handle image cover uniform mat4 uTextureMatrix0; // pass your vertex and texture coords to the fragment shader varying vec3 vVertexPosition; varying vec2 vTextureCoord; void main() { vec3 vertexPosition = aVertexPosition; gl_Position = uPMatrix * uMVMatrix * vec4(vertexPosition, 1.0); // set the varyings // here we use our texture matrix.........完整代码请登录后点击上方下载按钮下载查看
网友评论0