Skip to content

Instantly share code, notes, and snippets.

@keijiro
Last active October 6, 2019 19:54
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save keijiro/2c6e9c307ced737d53466a68c6fba11d to your computer and use it in GitHub Desktop.
Save keijiro/2c6e9c307ced737d53466a68c6fba11d to your computer and use it in GitHub Desktop.
Processing sketches used to generate VFX particle textures

These are Processing sketches that I used to create VFX particle textures in a Unity project.

Usage example:

gif

Disk.pde

Generates a simple disk particle.

png

Stretched.pde

Generates a vertically stretched disk particle. This is convenient to draw fast-moving particles. The outline is slightly blurred to immitate motion blur effect.

png

size(32, 32);
background(0);
fill(255);
noStroke();
float r = width / 2;
circle(r, r, r * 1.5);
save("Disk.png");
size(32, 64);
background(0);
fill(255);
noStroke();
float r = width / 2;
float w = r / 1.1;
float h = r * 1.1;
ellipse(r, h, w * 1.5, h * 1.5);
ellipse(r, height - h, w * 1.5, h * 1.5);
rect(r - w * 1.5 / 2, h, w * 1.5, height - h * 2);
filter(BLUR, 1);
save("Stretched.png");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment