three打造三维变色星空空间移动效果代码
代码语言:html
所属分类:三维
代码描述:three打造三维变色星空空间移动效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<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 {
background-color: black;
height: 100vh;
margin: 0;
padding: 0;
overflow: hidden;
}
iframe {
width: calc(100% + 112px);
height: 58px;
opacity: 0.85;
position: absolute;
top: -6px;
left: -110px;
}
</style>
</head>
<body>
<div id="canvas-wrapper" aria-label="3D Stars"></div>
<script id="vertex" type="x-shader/x-vertex">
void main() { gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }
</script>
<script id="fragment" type="x-shader/x-vertex">
#ifdef GL_ES
precision highp float;
#endif
uniform vec2 u_resolution;
uniform float u_time;
void main() {
vec2 uv = (gl_FragCoord.xy - u_resolution * .5) / u_resolution.yy + 0.5;
float t = u_time*0.8;
float n = 12.;
float cAnim = sin(u_time*0.25); // Same anim as particles
vec3 c1 = vec3(0.0);
vec3 c2 = vec3(0.29+cAnim, 0.50-cAnim, 0.68+cAnim); // Sa.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0