Logo by kr0mat1k - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Visit the official fractalforums.com Youtube Channel
 
*
Welcome, Guest. Please login or register. March 29, 2024, 10:48:50 AM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: Fragmentarium programming  (Read 1999 times)
0 Members and 1 Guest are viewing this topic.
JosLeys
Strange Attractor
***
Posts: 258


WWW
« 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!

* HF.frag (6.25 KB - downloaded 145 times.)

* HF_test.jpg (72.23 KB, 1314x768 - viewed 271 times.)
Logged
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #1 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").
Logged
JosLeys
Strange Attractor
***
Posts: 258


WWW
« Reply #2 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?
Logged
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #3 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
Logged
JosLeys
Strange Attractor
***
Posts: 258


WWW
« Reply #4 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...
Logged
knighty
Fractal Iambus
***
Posts: 819


« Reply #5 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  sad.
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...  wink
- 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.
Logged
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Recreational Programming. Non-Fractal related Chit-Chat Ryan_Burnside 5 1077 Last post November 29, 2012, 06:32:48 AM
by Ryan_Burnside
Programming Help UltraFractal Diddy 2 634 Last post June 07, 2013, 11:33:55 PM
by cKleinhuis
Where can i get some more info bout programming in fragmentarium Fragmentarium « 1 2 » Haven 16 9185 Last post February 20, 2016, 09:56:43 AM
by 3dickulus
programming language frequency generator Programming NYMAREK 1 3741 Last post December 05, 2015, 08:06:26 AM
by ker2x
Programming tutorial for SPH simulation Programming ker2x 2 2013 Last post April 13, 2017, 04:18:46 PM
by _revers_

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.152 seconds with 25 queries. (Pretty URLs adds 0.006s, 2q)