Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // A very cool fire palette 2D perlin noise routine.
- // This was written for the Processing language.
- void setup() {
- size(600, 600);
- background(0);
- }
- float scale = 200;
- float scale2 = 100;
- float c = 0;
- float d = 0;
- float e = 0;
- void draw() {
- c = c + 0.02;
- d = d + 0.04;
- e = e + 0.01;
- for (int i = 0; i < 400; i++) {
- for (int j = 0; j < 400; j++) {
- float r = (noise((i / scale), (j / scale) + c));
- r = map(r, 0.2, 0.7, 0, 255);
- float shift2 = (r - 128) / 500;
- float g = (noise(((i / 2) / scale) + (r / 1000), (j / 2 / scale) + 3));
- g = map(g, 0.2, 0.7, 0, 255);
- float shift = (g - 128) / 100;
- float b = (noise((i / scale2) + shift, (j / scale2) + shift2));
- b = map(b, 0.3, 0.7, 0, 255);
- color c = color(b, b - g, 0);
- set (i + 100, j + 100, c);
- }
- }
- updatePixels();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement