Dax's Wiki
Register
Advertisement
  1. // Shader that makes you puke by Gaeel (Sugardude), modified daxnitro curvature.
  2. version 120 // This will always get moved to the top of the code in pre-processing.
  3. const float WORLD_RADIUS = 250.0;
  4. const float WORLD_RADIUS_SQUARED = 62500.0;
  5. ifdef _ENABLE_GL_TEXTURE_2D
  6. centroid varying vec4 texCoord;
  7. endif
  8. uniform int worldTime;
  9. varying vec4 vertColor;
  10. void main() {
  11. vec4 position = gl_ModelViewMatrix * gl_Vertex;
  12. if (gl_Color.a != 0.8) {
  13. // Not a cloud.
  14. float distanceSquared = position.x * position.x + position.z * position.z;
  15. position.y += 5*sin(distanceSquared*sin(float(worldTime)/143.0)/1000);
  16. float y = position.y;
  17. float x = position.x;
  18. float om = sin(distanceSquared*sin(float(worldTime)/256.0)/5000) * sin(float(worldTime)/200.0);
  19. position.y = x*sin(om)+y*cos(om);
  20. position.x = x*cos(om)-y*sin(om);
  21. }
  22. gl_Position = gl_ProjectionMatrix * position;
  23. ifdef _ENABLE_GL_TEXTURE_2D
  24. texCoord = gl_MultiTexCoord0;
  25. endif
  26. vertColor = gl_Color;
  27. gl_FogFragCoord = gl_Position.z;
  28. }
Advertisement