twgl实现webgl Bayer纹理动画效果代码

代码语言:html

所属分类:动画

代码描述:twgl实现webgl Bayer纹理动画效果代码

代码标签: twgl webgl Bayer 纹理 动画

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  

  
  
<style>
html {
  height: 100%;
}
body {
  background: #000;
  overflow: hidden;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0;
  margin: 0;
}
canvas {
  height: 100%;
  width: 100%;
}
</style>


  
  
</head>

<body translate="no">
  <canvas id="canvas"></canvas>
<!-- VertexShader code here -->
<script id="vertexShader" type="x-shader/x-vertex">#version 300 es
precision highp float;
  in vec4 position;
  void main() {
    gl_Position = vec4( position );
  }
</script>

<script id="mainShader" type="x-shader/x-fragment">#version 300 es
  #if __VERSION__ < 130
  #define TEXTURE2D texture2D
  #else
  #define TEXTURE2D texture
  #endif
  precision highp float;
  out vec4 fragColor;
  
  uniform vec4 u_mouse;
  uniform vec2 u_resolution;
  uniform float u_time;
  uniform.........完整代码请登录后点击上方下载按钮下载查看

网友评论0