We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I have a sketch that's using a few long arrays and image processing.
Is there a way to make openGL render the sketch, or any other simple "trick" to improve performance?
Answers
P2D and P3D use opengl by default
I've added P2D to size() but it doesn't seem to affect performance. Is there a way to quickly make a working code P2D?
add P2D to size()...
asking us to fix the improvement of code we can't see is kind of impossible. you could be doing ANYTHING.
Sorry :) I was wondering if there's any simple code I could add to make the the sketch render with P2D.
here's the code (sorry about the mess):
edit post, highlight code, press ctrl-o to format.
you'll probably need to undo whatever formatting you've already tried to apply.
red() green() and blue() are expensive. use bitshifting instead
we have none of these files so we can't really run the code
kill line 182.
use dist() or distSq() on line 185. 288 also. you have a variable called dist which clashes with the standard dist() method. it's not an error but it makes things hard to follow.
ctrl-t in the pde editor will indent your code nicely.
if you are only ever drawing grey images then you don't need to check the red green and blue for the pixels - all three channels will be the same so you only need to check one.
Hi
Thank you so much for your answers! :) replaced red/green/blue with rightshift
blur piano and celloop are for future functionality.
the rgb is from the original motion detection code. Do you think it's redundant?