Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Mandelbrot Fractal Explorer  (Read 9743 times)

0 Members and 1 Guest are viewing this topic.

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Mandelbrot Fractal Explorer
« on: September 08, 2012, 08:34:56 pm »
I would like to show a small project I've been working on for a fews days now.

It's a Mandelbrot fractal explorer. You can zoom in up to 10.000.000.000.000 times and get precise rendering even at such scales (but at the cost of more rendering time). Move wherever you want, take screenshots and enjoy!

The explorer uses SFML to display the result, Thor to handle user commands and Intel TBB to parallelize work and accelerate rendering by using all of the available CPU cores (you may soon have a cooker integrated in your computer!).






Downloads

If you want to give it a try on Windows:
- in case you don't already have Visual C++ 2010 installed, download the Visual C++ 2010 Redistributable Package and install it
- download the Fractal Explorer

And on OS X 10.7+:
- download the Fractal Explorer

You can have a look at the sources if you're interested but there's no easy way to build the program for now and there's been small modifications in the meantime. So it's mostly for curiosity purpose :) .


I hope you'll enjoy the exploration as much as I did!
Any feedback or comment is of course welcome :)
« Last Edit: September 10, 2012, 01:15:37 pm by Ceylo »
Want to play movies in your SFML application? Check out sfeMovie!

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Mandelbrot Fractal Explorer
« Reply #1 on: September 08, 2012, 08:46:12 pm »
Nicely done, I like it! :)

Can you tell us a bit more how you went about rendering it? I mean what do you exactly do? Draw all the pixels on your own?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Re: Mandelbrot Fractal Explorer
« Reply #2 on: September 08, 2012, 09:11:46 pm »
Yes sure!

A texture of the size of your screen and a buffer are created. The buffer is large enough to store all of the pixels that'll be sent to the texture.

The pixels are stored as RGBA data in that buffer. All of these pixels are set according to Mandelbrot formula (which can tell you wether a point belongs to the fractal), and as pixels don't depend on each other, I can parallelize that work. Once everything is rendered, pixels are sent to the texture and displayed. So actually, the only part of the fractal that is rendered is the one you see on the screen. That's also why rendering must be redone each time you want to move in the fractal.

I can't render the whole fractal except when it's not scaled, because it would take way to much time and memory to compute and store millions of billions of pixels.
Want to play movies in your SFML application? Check out sfeMovie!

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Mandelbrot Fractal Explorer
« Reply #3 on: September 09, 2012, 12:50:46 pm »
Very nice! :)

It looks good, and the blue colors are well chosen (not that pink-green-blue mess you see at some other Mandelbrot figures).

When I zoom far in (x 1e13), the fractal becomes pixelized. Does this happen because the floating point numbers lose precision?
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Re: Mandelbrot Fractal Explorer
« Reply #4 on: September 09, 2012, 01:05:44 pm »
Thanks!

Yes indeed it becomes pixellated, that's why I said you can zoom in up to this scale. But honestly for now I don't know where the error happens. The floating point precision error makes sense as errors are of 1e15 with double type, so indeed the accumulation of computation errors may make it pixellated at 1e13.
Want to play movies in your SFML application? Check out sfeMovie!

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Re: Mandelbrot Fractal Explorer
« Reply #5 on: September 10, 2012, 01:16:18 pm »
I've added a little video of the explorer in the first post :)
Want to play movies in your SFML application? Check out sfeMovie!

TheSilverWebsurfer

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Mandelbrot Fractal Explorer
« Reply #6 on: September 12, 2012, 05:07:48 pm »
Wow, I'm really impressed!

I used Mandelbulb, which makes it in 3D, but can take a lot of time to render scene.

But your soft is really beautiful, so are the fractals it produces, and the zoom feature is astonishing!

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Re: Mandelbrot Fractal Explorer
« Reply #7 on: September 13, 2012, 07:58:39 pm »
Thanks TheSilverWebsurfer!

I'm currently trying to see if I can get even faster rendering and responsive UI even while rendering. And in the meantime I found out some interesting areas in the fractal. For those that are interested, see http://cl.ly/image/2g2m0j361J1s
Want to play movies in your SFML application? Check out sfeMovie!