Advertisement
Guest User

Untitled

a guest
Jan 2nd, 2013
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.38 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="utf-8">
  5.     <title>One Sphere Orbiting</title>
  6.     <link rel="stylesheet" href="css/untangle.css" />
  7.     <style>
  8.         #container {
  9.             background: #000;
  10.             width: 400px;
  11.             height: 300px;
  12.         }
  13.     </style>
  14. </head>
  15. <body>
  16.  
  17.     <body>
  18.  
  19.         <div id="container"></div>
  20.  
  21.     </body>
  22.     <script src="js/jquery-1.8.3.min.js"></script>
  23.     <script src="js/three.min.js"></script>
  24.     <script id="fragmentShader" type="x-shader/x-fragment">
  25.         uniform float time;
  26.         uniform sampler2D texture1;
  27.         uniform sampler2D texture2;
  28.         varying vec2 texCoord;
  29.         void main( void ) {
  30.             vec4 noise = texture2D( texture1, texCoord );
  31.             vec2 T1 = texCoord + vec2( 1.5, -1.5 ) * time * 0.01;
  32.             vec2 T2 = texCoord + vec2( -0.5, 2.0 ) * time * 0.01;
  33.             T1.x -= noise.r * 2.0;
  34.             T1.y += noise.g * 4.0;
  35.             T2.x += noise.g * 0.2;
  36.             T2.y += noise.b * 0.2;
  37.             float p = texture2D( texture1, T1 * 2.0 ).a + 0.25;
  38.             vec4 color = texture2D( texture2, T2 );
  39.             vec4 temp = color * 2.0 * ( vec4( p, p, p, p ) ) + ( color * color );
  40.             gl_FragColor = temp;
  41.         }
  42.     </script>
  43.     <script id="vertexShader" type="x-shader/x-vertex">
  44.         varying vec2 texCoord;
  45.         void main()
  46.         {
  47.             texCoord = uv;
  48.             vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
  49.             gl_Position = projectionMatrix * mvPosition;
  50.         }
  51.     </script>
  52.     <script src="js/fp.solar.js"></script>
  53. </body>
  54. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement