We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I'm fairly new to processing, and I am trying to make a space scene in which the stars in the background are blurred, and there is another very blurred large star. and it leaves the planet untouched. My problem is that when I apply a blur, it applies to all parts of the sketch. Is there a way to get around this?
Code:
void setup () {
size (900, 506);
background (0, 0, 12);
drawStars ();
drawPlanets ();
drawLargeStar ();
}
void draw () {
}
void drawPlanets () {
drawPlanet (300, 110, 50);
pushMatrix ();
scale (.1);
drawPlanet (1000, 1000, 100);
popMatrix ();
}
void drawPlanet (int x, int y, int grey) {
translate (x, y);
stroke (0);
fill (150, 150, 255);
ellipse (0, 0, 708, 698);
fill (255);
ellipse (0, 0, 697, 687);
fill (grey);
ellipse (0, 0, 680, 680);
}
void drawStars () {
for (int num = 0; num < 400; num++) {
fill (255);
stroke (random (0, 255), random (0, 255), random (0, 255));
ellipse (random (0, 900), random (0, 506), random (1, 8), random (1, 8));
}
filter(BLUR, 4);
}
void drawLargeStar () {
fill (255);
stroke (255);
ellipse (450, 200, 150, 150);
}
Answers
https://Processing.org/reference/PGraphics.html
https://www.Reddit.com/r/processing/comments/4753bc/how_to_make_blurs_run_independently_in_custom/