mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-13 16:37:30 +00:00
3508972d66
It seems I misunderstood the sw turbulence code.
22 lines
464 B
GLSL
22 lines
464 B
GLSL
uniform sampler2D palette;
|
|
uniform sampler2D texture;
|
|
uniform float realtime;
|
|
|
|
varying vec2 tst;
|
|
|
|
const float SPEED = 20.0;
|
|
const float CYCLE = 128.0;
|
|
const float PI = 3.14159;
|
|
const float FACTOR = PI * 2.0 / CYCLE;
|
|
|
|
void
|
|
main (void)
|
|
{
|
|
float pix;
|
|
vec2 rt = vec2 (realtime, realtime);
|
|
vec2 st;
|
|
|
|
st = tst + sin ((tst.ts * 64.0 + rt * SPEED) * FACTOR);
|
|
pix = texture2D (texture, st).r;
|
|
gl_FragColor = texture2D (palette, vec2 (pix, 0.5));
|
|
}
|