gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS homebrew announcements > Mandelbrot Fractal App

#154145 - TheMagnitude - Fri Apr 11, 2008 10:55 pm

I started work on this just two days ago, and would like to see what all you guys think of it. It can zoom in 4096x total.

More info, screenshot, and download link is avaliable on my website:

http://themagnitude.co.uk/index.php?cmd=apps&id=7

If you download can you reply with some constructive critism please, I'd very much to develop this app more.

Also I've posted the source on my site but you have to register if you want source codez.

#154150 - strager - Fri Apr 11, 2008 11:28 pm

You application runs pretty slow, relatively. You can look into successive refinement for much faster rendering, for example. It would perfectly apply here as much of what you are doing is zooming.

It'd be great to select a rectangular region (with a fixed ratio) on the touch screen and zoom to that view.

More colours, please! It'd be awesome to see a rainbow of colours in there. ;D

Otherwise, great job on the little app. It seems you are relatively new to DS programming; keep it up!

Also, I'd like to mention sgstair is hosting a Mandelbrot optimization contest. It'd be great to have some (more) competition!

#154174 - TheMagnitude - Sat Apr 12, 2008 7:37 am

Thanks for trying it out strager, Ive seen that contest before but I lost the link so thanks for posting the link :D, I was originally doing to do the select rectangular region but it didnt work for a very strange reasion:

Code:
updateTouch(&touch);
if (keysDown() & KEY_TOUCH)
{
// i can access touch.px and touch.py in here
}
if (keysUp() & KEY_TOUCH)
{
// i can access touch.px and touch.py in here but they are set to zero :(
}

So i gave up on that lol.

#154186 - strager - Sat Apr 12, 2008 6:16 pm

What you want is to store the coordinates only when they are available. When the screen is un-touched, grab the last coordinate value and set it as the ending point.

Code:
int startX = 0, startY = 0;
int endX = 0, endY = 0;

updateKeys();

if(/* Touch just touched (old = 0, new = 1). */)
{
    updateTouch(&touch);

    startX = touch.px;
    startY = touch.py;
}
else if(/* Touched just released (old = 1, new = 0). */)
{
    endX = touch.px;
    endY = touch.py;

    zoom(startX, startY, endX, endY);
}


Untested pseudo code. Should give you the idea, though... Unless I'm wrong.

#154188 - simonjhall - Sat Apr 12, 2008 6:25 pm

Cool man, looking cool and esp as strager says - a good start to DS programming!
More speed is definately my feature request
a) successive refinement sounds a good way to go
b) caching of previous parts of the image for, say, if you're tracking from side to side
c) parallel processing is definately an option, and could be a good excuse to play around with the ARM7!

Looking forward to seeing what you come up with in v2...
_________________
Big thanks to everyone who donated for Quake2

#154904 - TheMagnitude - Tue Apr 22, 2008 7:12 pm

simonjhall wrote:
Cool man, looking cool and esp as strager says - a good start to DS programming!
More speed is definately my feature request
a) successive refinement sounds a good way to go
b) caching of previous parts of the image for, say, if you're tracking from side to side
c) parallel processing is definately an option, and could be a good excuse to play around with the ARM7!

Looking forward to seeing what you come up with in v2...


Sorry I took so long to reply but Im not to sure how to go about doing any of those things :( Ive looked around the internet for ages and am still no closer. Can someone explain how to do any of them?

#154912 - strager - Tue Apr 22, 2008 10:15 pm

TheMagnitude wrote:
simonjhall wrote:
Cool man, looking cool and esp as strager says - a good start to DS programming!
More speed is definately my feature request
a) successive refinement sounds a good way to go
b) caching of previous parts of the image for, say, if you're tracking from side to side
c) parallel processing is definately an option, and could be a good excuse to play around with the ARM7!

Looking forward to seeing what you come up with in v2...


Sorry I took so long to reply but Im not to sure how to go about doing any of those things :( Ive looked around the internet for ages and am still no closer. Can someone explain how to do any of them?


For successive refinement, see Successive Refinement, Mu-Ency at MROB as I posted earlier.

By caching simonjhall means storing calculated values around the view port. When the view port is moved, these cached values are read instead of recalculated.

Parallel processing would be a bit difficult for an inexperienced programmer. It involves using the ARM7 to calculate some values while the ARM9 calculates the rest. This would greatly speed up processing (by at least 130%).

#155013 - TheMagnitude - Wed Apr 23, 2008 10:38 pm

I implemented successive refinement and from loading the entire thing (from start pos) at 18 seconds it went up to about 22 seconds? Isnt this supposed to be a faster method?

EDIT: Sorry my bad I only implemented up to stage 2 of successive refinement, now that ive done stage 3 it loads at about 5 seconds (thanks!) :P.

Can you tell me how to do parrellel processing please? Or link me to a tutorial :) ?

#155052 - Maxim - Thu Apr 24, 2008 2:01 pm

The first stage of successive refinement ought to be just as fast, the point is to give a low-res image quickly. Your timings suggest some inefficiency in your implementation.

The "third stage" can produce inaccuracies, you ought to at least make it optional. Or, generate the skipped pixels as a final pass.

#155057 - TheMagnitude - Thu Apr 24, 2008 4:53 pm

Maxim wrote:
The first stage of successive refinement ought to be just as fast, the point is to give a low-res image quickly. Your timings suggest some inefficiency in your implementation.

The "third stage" can produce inaccuracies, you ought to at least make it optional. Or, generate the skipped pixels as a final pass.
It looks pretty accurate to me...however in the final version there will be alot of room for custimisability