I try to calculate a fractal image, and as the calculation could be long as the resolution increase, I was wondering if I could use Hyper Threading to calculate "tiles" of my final image and then have the result. But all my tries to split Threads or Tasks ended by a slower calculation than the way I showed below (just brute force all values in a for loop).
Also, I don't have NVidia GPU, and I wonder I that kind of calculation could be fasten up by OpenCL ?
For now all whay I have is creating a Bitmap with a given resolution and number of dots per side.
Image Generate() {
DateTime n = DateTime.Now;
Console.WriteLine("Generating...");
Image img = new Bitmap(resolution, resolution);
Graphics g = Graphics.FromImage(img);
double step = ((px - mx) / points) * 0.5d;
for (double x = mx; x < px; x += step) {
for (double y = my; y < py; y += step) {
ParseDot(CreateDot(new Complex(x, y)), g);
}
}
Console.WriteLine("Dots parsed (" + (DateTime.Now - n).TotalMilliseconds + ")");
pictureBox1.BackgroundImage = img;
pictureBox1.Refresh();
isComputing = false;
return img;
}
Thanks for any tips :)