twgl实现彩色条纹webgl canvas背景效果代码

代码语言:html

所属分类:背景

代码描述:twgl实现彩色条纹webgl canvas背景效果代码

代码标签: 条纹 webgl canvas 背景 效果

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

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

<head>

  <meta charset="UTF-8">
  

  
  
<style>
body {
 margin: 0;
}

canvas {
 position: fixed;
 width: 100vw;
 height: 100vh;
}
</style>



</head>

<body >
  <!-- Quick start shader template: https://codepen.io/pen/?template=ZEyrWNe -->

<!-- Based on Roni Kaufman's work: https://twitter.com/KaufmanRoni/status/1440285424425918467/photo/1 -->

<!-- For educational purposes only, not for commerical use nor resale as digital artwork. -->

<canvas id="canvas"></canvas>

<script id="vertexShader" type="x-shader/x-vertex">
  attribute vec4 position;

  void main() {
    gl_Position = vec4( position );
  }
</script>

<script id="fragmentShader" type="x-shader/x-fragment">
  #ifdef GL_ES
  precision mediump float;
  #endif

  uniform vec2 u_resolut.........完整代码请登录后点击上方下载按钮下载查看

网友评论0