three+webgl实现炫酷光影动画效果代码

代码语言:html

所属分类:动画

代码描述:three+webgl实现炫酷光影动画效果代码

代码标签: three webgl 炫酷 光影 动画

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

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

<head>

  <meta charset="UTF-8">
  

  
  
  
<style>
body{
		margin:0;
		overflow:hidden;
		background-color:#000;
}
canvas{
		background-color:#000;
}
a{
  position:absolute;
  bottom:20px;
  right:20px;
  color:#ccc;
  text-decoration:none;
  font-family:Arial;
  font-size:10px;
}
</style>


</head>

<body>
  <canvas id="main"></canvas>



	<script type="x-shader/x-vertex" id="vertexshader">
		//
		// GLSL textureless classic 3D noise "cnoise",
		// with an RSL-style periodic variant "pnoise".
		// Author:  Stefan Gustavson (stefan.gustavson@liu.se)
		// Version: 2011-10-11
		//
		// Many thanks to Ian McEwan of Ashima Arts for the
		// ideas for permutation and gradient selection.
		//
		// Copyright (c) 2011 Stefan Gustavson. All rights reserved.
		// Distributed under the MIT license. See LICENSE file.
		// https://github.com/ashima/webgl-noise
		//
		vec3 mod289(vec3 x)
		{
		  return x - floor(x * (1.0 / 289.0)) * 289.0;
		}
		vec4 mod289(vec4 x)
		{
		  return x - floor(x * (1.0 / 289.0)) * 289.0;
		}
		vec4 permute(vec4 x)
		{
		  return mod289(((x*34.0)+1.0)*x);
		}
		vec4 taylorInvSqrt(vec4 r)
		{
		  retur.........完整代码请登录后点击上方下载按钮下载查看

网友评论0