three打造的走光效果
代码语言:html
所属分类:三维
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> Carpe Noctem</title>
<style>
body {
margin: 0;
padding: 0;
}
#container {
position: fixed;
touch-action: none;
}
</style>
</head>
<body translate="no">
<script src="http://repo.bfw.wiki/bfwrepo/js/three.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 bool u_mousemoved;
const bool shapeTest = false; // Whether to just show the shape test
const bool addNoise = true; // Whether to add noise to the rays
const float decay = .98; // the amount to decay each sample by
const float exposure = .2; // the screen exposure
const vec3 lightcolour = vec3(.5); // the colour of the light
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0