And the Code runs very well in PC(Laptop).(It runs fluently)
But when I tried to run it on Android Device it became very slow. (i guess one frame / 2 Seconds) The Core Code is here
void draw() {
background(51);
loadPixels();
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
int index = x + y * width;
float sum = 0;
for (Blob b : blobs) {
float d = dist(x, y, b.pos.x, b.pos.y);
sum += 10 * b.r / d;
}
pixels[index] = color(sum, 255, 255);
}
}
updatePixels();
for (Blob b : blobs) {
b.update();
}
}
Can anyone help me, what is the problem here?
Because it loads every pixel and does pixel processing, so it uses CPU? How can I do pixel Processing using GPU?(I am not sure, if i express this correctly, i have no experience in computer graphics)
Thanks