three+dat.gui实现无限循环彩色洞穴穿越动画效果代码
代码语言:html
所属分类:动画
代码描述:three+dat.gui实现无限循环彩色洞穴穿越动画效果代码,可修改速度、色彩、放大、形状、旋转等参数。
代码标签: three dat.gui 无限 循环 彩色 洞穴 穿越 动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
body {
top: 0;
margin: 0;
}
</style>
</head>
<body translate="no">
<canvas id="starryPlanes"></canvas>
<script id="vertexShader" type="x-shader/x-vertex">
varying vec2 vUv;
void main() {
vUv = uv;
gl_Position = vec4(position, 1.0);
}
</script>
<script id="fragmentShader" type="x-shader/x-fragment">
uniform vec2 iResolution;
uniform float iTime;
uniform float speed;
uniform float rotation;
uniform float colorCycleSpeed;
uniform float colorIntensity;
uniform bool useSquares;
uniform bool enableTeleidoscope;
uniform float zoom;
uniform int teleidoscopeSides;
uniform float teleidoscopeRotationSpeed;
#define TIME iTime
#define RESOLUTION iResolution
#define ROT(a) mat2(cos(a), sin(a), -sin(a), cos(a))
const float
pi = acos(-1.)
, tau = 2.*pi
, planeDist = .9
, furthest = 7.
, fadeFrom = 5.
;
const vec2
pathA = vec2(.31, .31)
, pathB = vec2(1.0,sqrt(0.5))
;
const vec4
U = vec4(0, 1, 2, 3)
;
// License: Unknown, author: Matt Taylor (https://github.com/64), found: https://64.github.io/tonemapping/
vec3 aces_approx(vec3 v) {
v = max(v, 0.0);
v *= 0.9;
float a = 2.51;
float b = 0.03;
float c = 2.43;
f.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0