Advertisement
Guest User

Gaeel

a guest
Mar 5th, 2011
80,592
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. // Shader that makes you puke by Gaeel (Sugardude), modified daxnitro curvature.
  2.  
  3. #version 120 // This will always get moved to the top of the code in pre-processing.
  4.  
  5. const float WORLD_RADIUS = 250.0;
  6. const float WORLD_RADIUS_SQUARED = 62500.0;
  7.  
  8. #ifdef _ENABLE_GL_TEXTURE_2D
  9. centroid varying vec4 texCoord;
  10. #endif
  11.  
  12. uniform int worldTime;
  13. varying vec4 vertColor;
  14.  
  15. void main() {
  16. vec4 position = gl_ModelViewMatrix * gl_Vertex;
  17.  
  18. if (gl_Color.a != 0.8) {
  19. // Not a cloud.
  20.  
  21. float distanceSquared = position.x * position.x + position.z * position.z;
  22. position.y += 5*sin(distanceSquared*sin(float(worldTime)/143.0)/1000);
  23. float y = position.y;
  24. float x = position.x;
  25. float om = sin(distanceSquared*sin(float(worldTime)/256.0)/5000) * sin(float(worldTime)/200.0);
  26. position.y = x*sin(om)+y*cos(om);
  27. position.x = x*cos(om)-y*sin(om);
  28. }
  29.  
  30. gl_Position = gl_ProjectionMatrix * position;
  31.  
  32. #ifdef _ENABLE_GL_TEXTURE_2D
  33. texCoord = gl_MultiTexCoord0;
  34. #endif
  35.  
  36. vertColor = gl_Color;
  37.  
  38. gl_FogFragCoord = gl_Position.z;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement