注册 登录 充值会员 退出
毕业设计 PHP源码
充值

html5 WebGL酷炫网页动画特效

作者/代码整理:  (转载请附加本文地址,带有“懒人原生”字样的谢绝转载) 发布日期:2018-01-27
html5 WebGL酷炫网页动画特效
6款html5 WebGL酷炫网页动画特效,结合TweenMax、Three.js创建形状,打造出各种动画效果都十分的好看。


js代码

				<script type="x-shader/x-vertex" id="wrapVertexShader">
					attribute float size;
					attribute vec3 color;
					varying vec3 vColor;
					void main() {
						vColor = color;
						vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
						gl_PointSize = size * ( 350.0 / - mvPosition.z );
						gl_Position = projectionMatrix * mvPosition;
					}
				</script>
				<script type="x-shader/x-fragment" id="wrapFragmentShader">
					varying vec3 vColor;
					uniform sampler2D texture;
					void main(){
						vec4 textureColor = texture2D( texture, gl_PointCoord );
						if ( textureColor.a < 0.3 ) discard;
						vec4 color = vec4(vColor.xyz, 1.0) * textureColor;
						gl_FragColor = color;
					}
				</script>

		<script src="js/three.min.js"></script>
		<script src="js/TweenMax.min.js"></script>