Hmm. I’m not seeing the same visual output behavior from the two codes, so this seems it might be more than just a performance question. Some differences at a glance – Processing sketch has a fixed size (as KumuPaul noted) – also, it is P3D for some reason…? There are a lot of duplicate local variables in class methods that could just be this.myclassvar
. The matrix is getting pushed and popped inside the class, which isn’t strictly necessary with this design – you could throw away the PVector center from the class and put one translate statement in draw – but matrix stack changes are only happening 6 times per frame, not 6000, so really not a big deal… and KumuPaul says it isn’t differences in blendMode… my next guess would be something inside drawWave or addVel, although I haven’t looked closely. First goal would be to have the sketches actually producing similar output, then see if there are optimization steps to take.
1 Like