Advertisement
atuline

Noise_3_layer.pde

Mar 30th, 2022
475
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. // A very cool fire palette 2D perlin noise routine.
  2.  
  3. // This was written for the Processing language.
  4.  
  5.  
  6. void setup() {
  7. size(600, 600);
  8. background(0);
  9. }
  10.  
  11. float scale = 200;
  12. float scale2 = 100;
  13. float c = 0;
  14. float d = 0;
  15. float e = 0;
  16.  
  17. void draw() {
  18.  
  19. c = c + 0.02;
  20. d = d + 0.04;
  21. e = e + 0.01;
  22.  
  23. for (int i = 0; i < 400; i++) {
  24. for (int j = 0; j < 400; j++) {
  25.  
  26. float r = (noise((i / scale), (j / scale) + c));
  27. r = map(r, 0.2, 0.7, 0, 255);
  28.  
  29. float shift2 = (r - 128) / 500;
  30.  
  31. float g = (noise(((i / 2) / scale) + (r / 1000), (j / 2 / scale) + 3));
  32. g = map(g, 0.2, 0.7, 0, 255);
  33.  
  34. float shift = (g - 128) / 100;
  35.  
  36. float b = (noise((i / scale2) + shift, (j / scale2) + shift2));
  37. b = map(b, 0.3, 0.7, 0, 255);
  38.  
  39.  
  40. color c = color(b, b - g, 0);
  41. set (i + 100, j + 100, c);
  42. }
  43. }
  44.  
  45. updatePixels();
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement