Adding
Code:tex.filter(GRAY);
right after the image() call will get rid of the green. It makes the smoke trail dimmer, but that should be fixable. That doesn't really fix the issue though, just papers over it. I would guess it's some kind of artifact of the scaling algorithm used for textures.
What's odd to me is that it's
green. A single pixel is four bytes representing alpha, red, green, blue in that order. Processing treats it like an int (which is also four bytes) and if there was some kind of weird effect where the least-significant bits get random "noise", I would expect that to show up as blue, not green. So, it beats me.
I like the effect, though. One thing I would suggest is making tex and tex2 a little bigger than the window, to get rid of the "clipping" effect at the corners. Something like:
Code:
public static final int TEXSIZE = 600;
public static final int HTEXSIZE = TEXSIZE/2;
PGraphics tex, tex2;
float angle;
void setup() {
size(400, 400);
tex = createGraphics(TEXSIZE, TEXSIZE, P3D);
tex2 = createGraphics(TEXSIZE, TEXSIZE, P3D);
angle = 0.08;
frameRate(25);
tex.background(0);
tex2.background(0);
}
void draw() {
tex.beginDraw();
tex.background(0);
// rotate around centre
tex.translate(HTEXSIZE, HTEXSIZE);
tex.rotate(angle);
// copy old image (using a slightly bigger copy so it flares)
tex.imageMode(CORNERS);
tex.image(tex2, -HTEXSIZE - 1, -HTEXSIZE - 2, HTEXSIZE + 5, HTEXSIZE + 2);
// draw new ellipse at centre
tex.stroke(255, 255, 255);
int x = (int)random(0, 30);
int y = (int)random(0, 30);
tex.ellipse(0, 0, x, y);
tex.endDraw();
// copy back to front, centered
image(tex, - (TEXSIZE - width)/2, - (TEXSIZE -height)/2);
// copy for next time
try {
tex2 = (PGraphics)tex.clone();
} catch (Exception e) {println("Error: " + e);}
}