Welcome, Guest. Please Login or Register.
May 5th, 2024, 12:38pm

Home Home Help Help Search Search Members Members Login Login Register Register
Arimaa Forum « fractal exploration screen saver »


   Arimaa Forum
   Arimaa
   Off Topic Discussion
(Moderators: christianF, supersamu)
   fractal exploration screen saver
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: fractal exploration screen saver  (Read 1145 times)
seanick
Forum Guru
*****



SeaNICK

    seanick
Email

Gender: male
Posts: 97
fractal exploration screen saver
« on: Jun 21st, 2006, 11:02am »
Quote Quote Modify Modify

Hi,  
One of the projects I have written probably the most C++ code on is a mandelbrot set fractal rendering screen saver, and it has been something I spent a lot of time figuring all of the various challenges out.
 
one of the more recent developments was the ability to generate random fractals that are actually interesting. The way I did this, was to generate coordinates using rand() between +2.0 and -2.0 in both the real and imaginary axes. Then in order to determine if those coordinates are worth actually displaying, I do an initial 9-pixel (3x3 square) render, basing the 9 points off the coordinates that would make up the corners of the actual monitor should I pick that location.  
 
Once I render those 9 pixels, I have values from 0-255 for each one, indicating the palette entry to display. 255 is the fill color (usually black) and 0-254 are the actual colors.  
 
A problem I had seen in an earlier attempt is that most numbers in that range were actually within the large black area in the middle that is all fill.  
so one parameter for my evaluation is the maximum number of Fill-color pixels (up to 9) that my sample square can have.  
the next is the number of unique palette entries used in those nine, and the third is the range from the lowest palette index to the highest.
 
the parameters I use currently are:
#define MAX_EXPLORER_DATAPTS   9
#define NUM_EXPLORER_CYCLES    10000
#define MIN_EXPLORER_EXTENTS   45
#define MIN_EXPLORER_DISTINCT   6
#define MAX_EXPLORER_FILL_POINTS  3
 
I loop the code NUM_EXPLORER_CYCLES times, and give up if by then I haven't found an interesting spot to display. So far I haven't really seen it fail to find a very interesting and unique image within less than 2000 tries. 10000 cycles of 9 pixels is still only 1/15th of the number of pixels on one of my two screens so there is not very much lag to do this search.  (oh yeah and one criteria for this screen saver was full multimon support! so many screen savers don't have it...)
 
That was actually the main point of this post, the evaluation method I used in that. (which at one point I thought a possible option for a bot eval technique as well- though in hindsight theres no way it could directly apply).
 
While i am already here though, I might as well mention another couple of optimizations I have made-  
1. pre-calculate all coordinates for the x axis in an array of values, and then for the y axis, before starting the render loop
2. pre-render the boundaries of 32x32 rectangles comprising the full size of the display. if one of the rectangles has all fill color for every pixel along the border then there is no reason to render the entire rectangle- each fill color takes the maximum number of loop cycles to calculate so just doing the borders makes it more efficient. (though now that I think about it I re-render each border twice - another opportunity for improvement). once the entire image is pre-scanned for blocks which are not interesting to render, I render the actual image and just fill the uninteresting blocks with all fill color.  
 
there are quite a few more optimizations but my screen saver still isn't as fast as some other versions of the fractal code I have written and also not as fast as fractal extreme. (quite a bit faster than ultra fractal though nowhere near as cool of effects/features.)
 
if anyone wants to see the screen saver itself let me know, I made an installer for windows XP and the like.  
 I don't have any idea what would be needed to make it work on linux but there are very few calls other than to the windows screensaver and GDI+ libraries that could be all that different, if anyone wants to try and port it let me know and I will provide the source.
« Last Edit: Jun 21st, 2006, 11:06am by seanick » IP Logged
omar
Forum Guru
*****



Arimaa player #2

   


Gender: male
Posts: 1003
Re: fractal exploration screen saver
« Reply #1 on: Jul 20th, 2006, 10:26pm »
Quote Quote Modify Modify

I would love to see it. I also wrote a Mandelbrot fractal program and also an IFS fractal program back in 1988 on an Apollo/Domain workstation.
IP Logged
seanick
Forum Guru
*****



SeaNICK

    seanick
Email

Gender: male
Posts: 97
Re: fractal exploration screen saver
« Reply #2 on: Jul 21st, 2006, 11:46am »
Quote Quote Modify Modify

ok, it's available at www.themotocam.com/ftp/screensaver.zip
 
 
contains the source, installer, and raw binary, plus the registry file and palette files in case your MSI is busted (like my roommate's work computer, which is why I included it).
« Last Edit: Jul 21st, 2006, 12:12pm by seanick » IP Logged
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Arimaa Forum » Powered by YaBB 1 Gold - SP 1.3.1!
YaBB © 2000-2003. All Rights Reserved.