From 36d49b50e5c61122ad8d494fcb59941ec16511fd Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sat, 1 Sep 2012 10:45:21 +0000 Subject: [PATCH] tutorial: replace white noise with ordered dithering. --- tutorial/03_noise.lolfx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tutorial/03_noise.lolfx b/tutorial/03_noise.lolfx index 861930c8..ef9b2d85 100644 --- a/tutorial/03_noise.lolfx +++ b/tutorial/03_noise.lolfx @@ -91,7 +91,8 @@ void main(void) float test = tmp.x * tmp.y + sin(3.0 * u_Time); /* Add some garbage noise */ - test += fract(sin(test * 938.437) * 137.0) / 2.0; + vec2 d = vec2(16.0, 9.0) * pass_Position; + test += 0.5 * (length(fract(d) - 0.5) - length(fract(d + 0.5) - 0.5)); vec3 points[4] = (test > 0.0) ? fire : water;