three实现渐变流体流动动画背景效果代码

代码语言:html

所属分类:背景

代码描述:three实现渐变流体流动动画背景效果代码

代码标签: three 渐变 流体 流动 动画 背景

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

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

<head>

 
<meta charset="UTF-8">

 
 
 
<style>
* {
 
-webkit-user-select: none;
     
-moz-user-select: none;
     
-ms-user-select: none;
         
user-select: none;
}

body
{
 
height: 100vh;
 
background-color: rebeccapurple;
 
margin: 0;
 
padding: 0;
 
overflow: hidden;
 
position: relative;
}
</style>



</head>

<body>
 
<!-- Shader Collab
 * By eliza & ilithya | 2020
 *
 * https://www.elizasj.com/
 * https://twitter.com/iamelizasj
 *
 * https://www.ilithya.rocks/
 * https://twitter.com/ilithya_rocks -->


<div id="shadercollab"></div>
<script id="vertex" type="x-shader/x-vertex">
       
void main() { gl_Position = vec4(position, 1.0); }
</script>

<script id="fragment" type="x-shader/x-fragment">
precision highp float;

uniform vec2 u_resolution;
uniform float u_time;
       
#define PI 3.14159265359

void main() {
        vec2 uv = (gl_FragCoord.xy - u_resolution * .5) / u_resolution.yy; // Move center to the top right and resize our pixels
       
        /* uv.x -> from right to left */
        /* uv.y -> from top to bottom */
       
        /.........完整代码请登录后点击上方下载按钮下载查看

网友评论0