fixed copy-paste bug in noise3
[andemo] / src / scr / testb.c
index a9be6a4..2e4af98 100644 (file)
@@ -35,6 +35,7 @@ static void draw(void)
        int i, j;
        float x, y, xr, yr, sz;
        float t = dsys.tmsec / 700.0f;
+       float foo = dsys_value("testb.hueflash");
 
        glUseProgram(sdr_foo);
        gl_begin(GL_QUADS);
@@ -42,12 +43,13 @@ static void draw(void)
                y = (i + 0.5f) / (NY/2.0f) - 1.0f;
                for(j=0; j<NX; j++) {
                        x = (j + 0.5f) / (NX/2.0f) - 1.0f;
-                       sz = cgm_lerp(1.0f, noise2(x * 5.0f, t) * noise2(y * 5.0f, t) * 2.5f, scr.vis);
+                       sz = cgm_lerp(1.0f, noise3(x * 5.0f, y * 5.0, t) * 2.0f, scr.vis);
                        if(sz < 0.0f) sz = 0.0f;
                        if(sz > 1.0f) sz = 1.0f;
                        xr = sz / NX;
                        yr = sz / NY;
 
+                       gl_color3f(1, cgm_lerp(1, 0.7, foo), cgm_lerp(1, 0.3, foo));
                        gl_vertex2f(x - xr, y - yr);
                        gl_vertex2f(x + xr, y - yr);
                        gl_vertex2f(x + xr, y + yr);