Title: Fragmentarium programming Post by: JosLeys on May 25, 2013, 01:54:45 PM I have tried to do, for the first time, some programming in Fragmentarium.
I took some existing code and shamelessly modified it. The frag file is attached. The code is for showing the M-set as a heightfield (see sample image). Question : (the graphics card in my laptop is an AMD Radeon HD 6850 M ) For the image below, I'm getting 1.9 to 2 fps in continuous mode. Is this normal for my card, or is my code inefficient? For a zoomed image, with more steps, the fps drops to 0.6-0.7. Note that the code is very simple : no shadows, no AO, no anti-aliasing, no... Any advice is much appreciated! Title: Re: Fragmentarium programming Post by: Syntopia on May 25, 2013, 03:15:12 PM On my 310M I got 1.0FPS at 1262*581, which would be roughly 0.7 FPS at 1 Megapixel.
The 310M is a lowend (73GFlops) card. As for your code, can't you compare with the existing heightfield implementation? You should be able to do a bit faster since the default raytracer uses HDR-float buffers, and accumulated rendering. Notice your card probably crashes if a frame takes more than 2 seconds to render, and you have not disabled the watchdog timer (Windows only "feature"). Title: Re: Fragmentarium programming Post by: JosLeys on May 25, 2013, 03:20:22 PM Is there a frag for a Mandelbrot heightfield in the examples collection that comes with the installation?
Title: Re: Fragmentarium programming Post by: Syntopia on May 25, 2013, 06:32:40 PM Yes, there should be one in the Knighty Collection:
https://raw.github.com/Syntopia/Fragmentarium/master/Fragmentarium-Source/Examples/Knighty%20Collection/MandelbrotHeightfield.frag Title: Re: Fragmentarium programming Post by: JosLeys on May 25, 2013, 06:49:04 PM Ok thanks, sorry I missed that.
Well, the fps I get with Knighty's implementation is less than with mine, so I guess the main influencing factor is my graphics card... Title: Re: Fragmentarium programming Post by: knighty on May 26, 2013, 09:30:49 PM Very nice. I particularly like the way the landcape becomes flat far away from MB set. Well, the fps I get with Knighty's implementation is less than with mine, so I guess the main influencing factor is my graphics card... That reminds me that I have never finished that script :sad1:. It's slower because, I guess : - It is using DE-Raytracer.frag which is quite complex. I get substatial speedup when using Fast-Raytracer.frag. - Using regular cone tracing should give some speedup. I was just too lazy to re-write the raytracing code. Now that you did it... ;) - clipping the rays about the z=0 plane should give a huge speedup. I think that's why your implementation is faster. To speed things up you could change the fudge factor (in : float d=0.25*R*log(R)/dR;) from 0.25 to 0.5 (or even up to 1). You can also use the "classic" derivative instead of the "scalar" derivative in order to save some costly length() functions calls. There are certainly some other GPU specific optimizations (Haven't tried them yet so may or may not work): - Do the test at the end of the loops: do{...}while(condition) is usually faster than for loops and while(condition){...} one. - in GPU programming conditionnals should be avoided as much as possible. If there is a solution other than binary search it would be faster. |