"#endif\n"
"#endif\n"
"\n"
+"#ifdef VERTEX_SHADER\n"
+"#ifdef USETRIPPY\n"
+"// LordHavoc: based on shader code linked at: http://www.youtube.com/watch?v=JpksyojwqzE\n"
+"// tweaked scale\n"
+"float4 TrippyVertex(float4 position)\n"
+"(\n"
+"uniform float ClientTime : register(c2)\n"
+")\n"
+"{\n"
+" float worldTime = ClientTime;\n"
+" // tweaked for Quake\n"
+" worldTime *= 10.0;\n"
+" position *= 0.125;\n"
+" //~tweaked for Quake\n"
+" float distanceSquared = (position.x * position.x + position.z * position.z);\n"
+" position.y += 5.0*sin(distanceSquared*sin(worldTime/143.0)/1000.0);\n"
+" float y = position.y;\n"
+" float x = position.x;\n"
+" float om = sin(distanceSquared*sin(worldTime/256.0)/5000.0) * sin(worldTime/200.0);\n"
+" position.y = x*sin(om)+y*cos(om);\n"
+" position.x = x*cos(om)-y*sin(om);\n"
+" return position;\n"
+"}\n"
+"#endif\n"
+"#endif\n"
+"\n"
"#ifdef MODE_DEPTH_OR_SHADOW\n"
"#ifdef VERTEX_SHADER\n"
"void main\n"
")\n"
"{\n"
" gl_Position = mul(ModelViewProjectionMatrix, gl_Vertex);\n"
+"#ifdef USETRIPPY\n"
+" gl_Position = TrippyVertex(gl_Position);\n"
+"#endif\n"
" Depth = gl_Position.z;\n"
"}\n"
"#endif\n"
")\n"
"{\n"
" gl_Position = mul(ModelViewProjectionMatrix, gl_Vertex);\n"
+"#ifdef USETRIPPY\n"
+" gl_Position = TrippyVertex(gl_Position);\n"
+"#endif\n"
" gl_FrontColor = float4(gl_Position.z, gl_Position.z, gl_Position.z, 1.0);\n"
"}\n"
"#endif\n"
" TexCoord2 = gl_MultiTexCoord1.xy;\n"
"#endif\n"
" gl_Position = mul(ModelViewProjectionMatrix, gl_Vertex);\n"
+"#ifdef USETRIPPY\n"
+" gl_Position = TrippyVertex(gl_Position);\n"
+"#endif\n"
"}\n"
"#endif\n"
"\n"
" TexCoord = mul(TexMatrix, gl_MultiTexCoord0).xy;\n"
" gl_Position = mul(ModelViewProjectionMatrix, gl_Vertex);\n"
" ModelViewProjectionPosition = gl_Position;\n"
+"#ifdef USETRIPPY\n"
+" gl_Position = TrippyVertex(gl_Position);\n"
+"#endif\n"
"}\n"
"#endif\n"
"\n"
" EyeVector.z = dot(EyeVectorModelSpace, gl_MultiTexCoord3.xyz);\n"
" gl_Position = mul(ModelViewProjectionMatrix, gl_Vertex);\n"
" ModelViewProjectionPosition = gl_Position;\n"
+"#ifdef USETRIPPY\n"
+" gl_Position = TrippyVertex(gl_Position);\n"
+"#endif\n"
"}\n"
"#endif\n"
"\n"
" VectorT = mul(ModelViewMatrix, float4(gl_MultiTexCoord2.xyz, 0)).xyz;\n"
" VectorR.xyz = mul(ModelViewMatrix, float4(gl_MultiTexCoord3.xyz, 0)).xyz;\n"
" gl_Position = mul(ModelViewProjectionMatrix, gl_Vertex);\n"
+"#ifdef USETRIPPY\n"
+" gl_Position = TrippyVertex(gl_Position);\n"
+"#endif\n"
" VectorR.w = gl_Position.z;\n"
"}\n"
"#endif // VERTEX_SHADER\n"
"#ifdef USEREFLECTION\n"
" ModelViewProjectionPosition = gl_Position;\n"
"#endif\n"
+"#ifdef USETRIPPY\n"
+" gl_Position = TrippyVertex(gl_Position);\n"
+"#endif\n"
"}\n"
"#endif // VERTEX_SHADER\n"
"\n"