Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / GPU Fractal Zoomer

Author
Message
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 1st Jun 2013 05:05 Edited at: 3rd Jun 2013 21:27
>>>DOWNLOAD<<<


This is a mandolbrot fractal zoomer written in GLSL using RenderMonkey, which means the algorithm runs on the graphics card rather than on the CPU.

I've been pushing this project around a lot, but never really had the chance to write a wrapper for it so it can be used for general use. Until now, that is.

I've included a binary release and the source code in the download.

For those who want to play with the binary

Simply download the files and navigate into the folder win32. Double-click on run_program.bat to start it.

Controls
*Left-click to zoom in
*Right-click to zoom out
*Scroll to change maximum iterations

NOTE: Iterations are clamped between 1 and 10'000.

You can change some settings by editing the batch file.



A full list of options are in the following code snippet:


For those who would like to tinker with the source code

The wrapper was written in C++ using SFML. In order to compile the code, you will need the following.
*A C++ compiler (VC++, gcc, clang) and an IDE (code::blocks, vs2008, etc.)
*SFML: http://www.sfml-dev.org/
*premake (to generate project files): http://industriousone.com/premake

For your convenience, I have pre-generated project files for vs2008, code::blocks, and MinGW Makefiles. These project files can be found in the dev folder in the download.

You can also clone this project from git: https://bitbucket.org/TheComet/gpu-fractal-zoomer

For those who want to see RESULTS

Here are some results on my computer. The resolution was 1024x768x32.









Current problems

You may notice you can't zoom in all that far. This is due to the low precision of floats on the GPU. There are ways to improve this, but I haven't had any time to do so yet.

Enjoy!

TheComet


Yesterday is History, Tomorrow is a Mystery, but Today is a Gift. That is why it is called "present".

Attachments

Login to view attachments
Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 1st Jun 2013 12:26
THE MASSES DEMAND SUPERSAMPLING![b][/b]


"I <3 u 2 bbz" - Dark Frager
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 1st Jun 2013 14:27
Quote: "THE MASSES DEMAND SUPERSAMPLING!

"


Neuro
Go home.
you're drunk.


Yesterday is History, Tomorrow is a Mystery, but Today is a Gift. That is why it is called "present".
swissolo
15
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 1st Jun 2013 18:27
Wow that is one fast brot calculator. It could zoom in in real time at those speeds

swis
Joined: Tue Dec 16th 2008
Interstellar
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 3rd Jun 2013 22:09
Guys
Where are you?
Guys
It feels like I'm talking to a wall.

I honestly expected some more feedback on this, but I guess no one is interested in being able to calculate a mandelbrot fractal with 10000 iterations in 16 milliseconds. Oh well.

Quote: "Wow that is one fast brot calculator. It could zoom in in real time at those speeds "


It does. Did you download it?

Here's a video of it at real time:



And here is a time lapse of me writing the software:



TheComet


Yesterday is History, Tomorrow is a Mystery, but Today is a Gift. That is why it is called "present".
swissolo
15
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 4th Jun 2013 00:17 Edited at: 4th Jun 2013 00:22
Quote: "Did you download it?"

I didn't want to look at the source code and those were all the links I saw. My monitor has a width of 2560 so the download button is waaaay over to right haha I missed it

Edit: Whoah indeed pretty cool. I couldn't zoom back out when I zoomed all the way in though (why did I even try lol)

swis
Joined: Tue Dec 16th 2008
Interstellar
Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 4th Jun 2013 02:25
It is definitely cool, I just don't know enough about fractals to give a proper compliment worthy of such an achievement.
so instead I will share my honest first thought which was...

Quote: "hahaha, That fractal has a bum!"


I'm not a complete idiot -- Some parts are just missing.
swissolo
15
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 4th Jun 2013 06:30 Edited at: 4th Jun 2013 06:31
Quote: "It is definitely cool, I just don't know enough about fractals to give a proper compliment worthy of such an achievement."

The most efficient one I could make in AppGameKit took about 4 seconds to render 32 interations while my best attempt in java took about 1/4 a second for 1024 (at 2560x1440 I should add)

swis
Joined: Tue Dec 16th 2008
Interstellar
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 5th Jun 2013 22:12
Thanks for testing!

I'm expanding on the functionality of this program, and will be introducing 3D fractals. Here are some pictures of the wonderful mandelbulb (not rendered by me). I will see if I can produce anything like this.





I will also introduce 4-dimensional fractals by expanding the complex numbers in Mandelbrot's equation to quaternions.

Here's my theory of 4D fractals:



Anyway, I'll keep you all updated.

TheComet


Yesterday is History, Tomorrow is a Mystery, but Today is a Gift. That is why it is called "present".
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 5th Jun 2013 22:35
I'm really interested in fractals but my maths isn't up to it yet. I think they will become an integral part of game development when games become so detailed that it would be infeasible to make every detail by hand. Look at this for example:


The difficulty in learning is not acquiring new knowledge but relinquishing the old.
The Zoq2
15
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 5th Jun 2013 22:40
Quote: "I'm really interested in fractals but my maths isn't up to it yet"


SAme thing im feeling. That terrain example is realy cool though
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 6th Jun 2013 02:06 Edited at: 6th Jun 2013 02:09
Thanks guys.

Request for help

Can someone who has a good understanding of 3D vectors please run over this code? It's producing... "weird" artifacts to say the least: http://www.imgwiz.com/images/2013/06/05/R65C3.png

It's very well commented, and should be self explanatory.

All I need to know is whether or not I'm calculating the ray correctly (orange line). It has nothing to do with fractals or the 4th dimension, it is simply transforming a screen coordinate into real world space.

Below is an image representing a camera in 3D space. The view frustum of the camera is defined through a 2D screen (ranging from -1,-1 to 1,1), and field of view (fovy). The aspect ratio is 1:1 (square). eyePosition and eyeDirection are the camera's position and direction respectively.



Vertex Shader


Fragment Shader


If it has any significance, the uniforms were set to the following values in the screen shot:



Thanks for your time.

TheComet


Yesterday is History, Tomorrow is a Mystery, but Today is a Gift. That is why it is called "present".
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 6th Jun 2013 02:26 Edited at: 6th Jun 2013 02:26
UPDATE

The problem still persists (above).

I did play around with a few values, and found something fractally when I set the camera's FOV to 0° (orthogonal), set the 4D-transformation matrix to be its identity matrix, and set the camera's position to 0,0,0.



The picture may look good, but nothing about the code is good.

I strongly suspect I'm doing something wrong when calculating the rays, so please, if anyone knows something about 3D vectors, help me out.

TheComet


Yesterday is History, Tomorrow is a Mystery, but Today is a Gift. That is why it is called "present".
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 6th Jun 2013 20:30
I figured out what the problem was.

Below is the first successful orthogonal render of a 4-dimensional fractal, without shading. It's definitely not what I expected to see. I went into this project blind, not knowing what to expect, but it seems it's just an infinite amount of 2D mandelbrot fractals stacked on to each other.



The 3D points were projected into the 4th dimension with a rather boring matrix (see below). I expect to get better results when I start slicing the 4D fractal with more interesting volumes.



TheComet


Yesterday is History, Tomorrow is a Mystery, but Today is a Gift. That is why it is called "present".
The Zoq2
15
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 6th Jun 2013 22:02
That looks pretty weird but you can see that it has a hint of mandelbrot in there. It will probably look a lot better when you get shading
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Jun 2013 14:08
Quote: "I strongly suspect I'm doing something wrong when calculating the rays"


This is a bit of a guess because I don't really know what you're trying to do, but your diagram seems to have put the eyeposition point in the projection plane instead of at the apex of the view frustum.

Login to post a reply

Server time is: 2025-05-15 13:04:27
Your offset time is: 2025-05-15 13:04:27