threejs+webgl实现彩色流体流动波纹动画效果代码
代码语言:html
所属分类:动画
代码描述:threejs+webgl实现彩色流体流动波纹动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
body {
margin: 0;
padding: 0;
}
#container {
position: fixed;
touch-action: none;
}
</style>
</head>
<body >
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/three.88.js"></script>
<script id="vertexShader" type="x-shader/x-vertex">
void main() {
gl_Position = vec4( position, 1.0 );
}
</script>
<script id="fragmentShader" type="x-shader/x-fragment">
uniform vec2 u_resolution;
uniform vec2 u_mouse;
uniform float u_time;
uniform sampler2D u_noise;
uniform sampler2D u_environment;
vec2 movement;
float scale = 5.;
vec2 hash2(vec2 p)
{
vec2 o = texture2D( u_noise, (p+0.5)/256.0, -100.0 ).xy;
return o;
}
const int octaves = 6;
float sinnoise(vec3 loc, float t){
t += u_time;
float s = (sin(t) * .5 + .5);
float c = (sin(t * 2.5) * .5 + .5);
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0