Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>One Sphere Orbiting</title>
- <link rel="stylesheet" href="css/untangle.css" />
- <style>
- #container {
- background: #000;
- width: 400px;
- height: 300px;
- }
- </style>
- </head>
- <body>
- <body>
- <div id="container"></div>
- </body>
- <script src="js/jquery-1.8.3.min.js"></script>
- <script src="js/three.min.js"></script>
- <script id="fragmentShader" type="x-shader/x-fragment">
- uniform float time;
- uniform sampler2D texture1;
- uniform sampler2D texture2;
- varying vec2 texCoord;
- void main( void ) {
- vec4 noise = texture2D( texture1, texCoord );
- vec2 T1 = texCoord + vec2( 1.5, -1.5 ) * time * 0.01;
- vec2 T2 = texCoord + vec2( -0.5, 2.0 ) * time * 0.01;
- T1.x -= noise.r * 2.0;
- T1.y += noise.g * 4.0;
- T2.x += noise.g * 0.2;
- T2.y += noise.b * 0.2;
- float p = texture2D( texture1, T1 * 2.0 ).a + 0.25;
- vec4 color = texture2D( texture2, T2 );
- vec4 temp = color * 2.0 * ( vec4( p, p, p, p ) ) + ( color * color );
- gl_FragColor = temp;
- }
- </script>
- <script id="vertexShader" type="x-shader/x-vertex">
- varying vec2 texCoord;
- void main()
- {
- texCoord = uv;
- vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
- gl_Position = projectionMatrix * mvPosition;
- }
- </script>
- <script src="js/fp.solar.js"></script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement