Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Challenge: 4,5 days for a 400x300 picture !
#31
for the next version of TC-Ray : I think that will give fantastic possibilities!

As for the sponge, I'm running a version where the cubes are not stored, but "calculated" at each probe:

I have precalculated the 20 possible translations within a cube, adimensionned (i.e. 1,0,0 or 1,0,1 for example). Then I apply successive translations, by adding translations that decrease from rank to rank: the loop looks like:

For k = 1 to 20
For m = 1 to 20
For n = 1 to 20
For p = 1 to 20

X0 = Tr1*Size1+Tr2*Size2+Tr3*Size3+Tr4*Size4
same on y
same on z

Probe.cube X0,Y0,Z0, Size(Rank%)

Next p
Next n
Next m
Next k

Of course, I can interleave 5, 6 or even 7 loops...
hink Global, Make Symp' All ! ®
[Image: Banner.gif]
Reply
#32
Jark one request. Try to make the next version of TC-Ray using C + Allegro =) (Though I havent figured out how to use Allegro in C Wink)
Reply
#33
Why? QB is just as effective... Smile
Reply
#34
I have downloaded the DJCPP complete environment, with Allegro. But it will take me months to learn all that stuff and reprog what I've done with QB...

The question for me is: shall I save more time by having faster progs than I would lose by learning C++ ??? :roll: :???:
hink Global, Make Symp' All ! ®
[Image: Banner.gif]
Reply
#35
I finally launched the prog, with four ranks on the sponge. That means 160000 cubes, i.e. 960000 polygons in a raytracer, the global object being coloured with a 7 octaves 3D perlin noise...

It took 10 minutes to draw the first row of a 400x300 picture: so it should take 50 hours for the complete picture.

Since QB slows down the machine (I also work with it!), I think I will stop it when I'm sure it's OK, and launch it friday evening to get the picture for sunday evening...

Here's the second rank picture... I let you imagine the future pic!
[Image: Cubes2.jpg]
hink Global, Make Symp' All ! ®
[Image: Banner.gif]
Reply
#36
50 Hours :o? Wow!

BTW I cannot even imagine what the future pic!

Neo: QB is not as effective as C/C++. QB will produce programs which are much much slower than C/C++'s programs. Also, C/C++ have pointers which makes your prog turbo charged =P. So there isnt any comparison between QB and C/C++ =P
Reply
#37
sweet mother f***ers. Those are amazing pics
url=http://www.spreadfirefox.com/?q=affiliates&id=0&t=79][Image: safer.gif][/url]
Reply
#38
Quote:The question for me is: shall I save more time by having faster progs than I would lose by learning C++ ??? :roll: :???:

Jark...My experience tells me you will see a ***50 to 100 x speed increase*** by moving to c++ .........which is, in my book, not insignificant!!!! Check out Dev-C++ If you continue your old way (no graphics...just output to files)...you don't even need alegro, or any other graphics lib...you can do all using standard c++... Anyway...nice work, and good luck.
Reply
#39
Jark:
My experience tells me the speed increase would be only 5x. That's what I had when I ported "down" Texel's screen 13 "3 blue balls" raytracer from C to QB. The original program used floating point math and poked directly to memory (no Allegro lib)and was to be compiled with DJGPP.

That speed increases of x50 probably occur only in all-integer programs..

So with C you would have your image in 10 hours ...The big gains are in better algorithms. When you have the fastest algorithm possible, that's the time to switch to a faster language.

Be warned the Atlantic coast of Europe will endure heavy weather this weekend ..
Antoni
Reply
#40
The weather is usually bad on the 1st of november, which is my birthday. Since I'm gonna be 40 tomorrow, the weather will be horrible :lol:

I do agree with your point of view about better algorithms, Antoni. I made comparisons between the Mandelbrot renderer of Melinda Green (http://mandelbrot.dazibao.free.fr/Tutorial/Super.exe) probably written in C, and TC-Mdb v1.1(http://mandelbrot.dazibao.free.fr/Tclib/Tcmdb11.zip).
For equivalent pictures, the Quick-Basic program is only two or three times slower.

I think the efficiency of QB is, obviously, not technical. Learning and using this not-so-simple language and this old-fashioned make it efficient, and that's it: I don't think I would have got the same results in one year and a half if I had gone directly into C++.

The main strength of C is the portability, which we don't have with QB.

As for the sponge, I de-randomized the prog (i.e., I replaced Randomize=Timer by Randomize = 76850 and Seed&=103476*RND by Seed& = 103476*.5): this way, I can cut the pic into slices, and run the prog part by part. I made the 62 first lines this night:
[Image: Cubes42.jpg]

Should get a complete picture by monday...
hink Global, Make Symp' All ! ®
[Image: Banner.gif]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)