PDA

View Full Version : Electrons 1.5



ErosOlmi
31-01-2007, 01:59
Here we are again with new Electrons example.
Have fun.
Eros

ErosOlmi
31-01-2007, 02:00
And this is secret future :)

kryton9
31-01-2007, 02:11
Eros, looks really cool. Can't wait for the next release!!

ErosOlmi
31-01-2007, 02:18
Secret version will depend from Petr. He is the master of OpenGl.
He is thinking about some speed optimization to render 3D surfaces on the fly. It is possible right now but takes to much time.
We will see ...

kryton9
31-01-2007, 02:25
Oh I see, cool stuff for sure, glad to know it is in the secret works!

ErosOlmi
31-01-2007, 02:31
Here a preview ...
Petr code is really clever!!!

To get difference between two models, find lines:

tbgl_m15RecalcNormals 1, %TBGL_NORMAL_PRECISE
'tbgl_m15RecalcNormals 1, %TBGL_NORMAL_SMOOTH

and try to change from %TBGL_NORMAL_PRECISE to %TBGL_NORMAL_SMOOTH line.

ATTENTION: it will take some time to calculate.

kryton9
31-01-2007, 08:25
That is really neat. Glad you mentioned about it taking time. The original version goes pretty quickly,
but the second version, the vertices get calculated in about the same time, but doing the normals does take a while
so be patient or you will get an error if you click on the ok button again as I did the first time :)

Great job guys, really impressive stuff!!

kryton9
31-01-2007, 09:12
Too much fun!!
Used for the surface equation:

function = x^2/3 + cos(z*4)*tan(x)

Petr Schreiber
31-01-2007, 09:41
Nice one kryton ;D,

it looks like some organic grid cell or something like it.
Current smoothing function is still so slow :(. I never tested it with really huge geometry,
but now I can see it is not fast enough. I think I'll try to use some pointer optimizations of the algo.

The "precise" way is fast enough I think, but the smoothing part, hmmm. Going to investigate what's going wrong.


Bye,
Petr

P.S. Credits for the axis, box and text part goes to Eros :)

kryton9
31-01-2007, 10:25
Once I learn Delphi more I can try to write something like this with that to see how fast it goes. I did do some opengl with Delphi as it is in the libraries in Delphi. But not much. Need to get the database stuff down soon. But later, will try to see what I can do when on breaks.

Petr Schreiber
31-01-2007, 10:40
Hi kryton9 and Eros !,

what would you say on boost of 96% !

On my PC the old smoothing algo was generating normals for 180 seconds ( yes, terrible ), now it does it in 11 seconds ;D. I just replaced some redundant function calls and used some nasty pointer tricks + one very evil optimization :D.

Could you try it ?


Bye,
Petr

ErosOlmi
31-01-2007, 11:29
I confirm I went from 20 secs to 2 secs to render using

tbgl_m15RecalcNormals 1, %TBGL_NORMAL_SMOOTH

Fantastic job Petr !!!

Below is kryton9 new function rendered with %TBGL_NORMAL_SMOOTH in just 2 secs (Intel Centrino 2 and ATI Mobility Radeon X1600).

ErosOlmi
31-01-2007, 12:51
Made some more tests and new TBGL seems as stable as before even if terrific speed improvement in rendering :D

So I will include in next thinBAsic update.

Ciao and THANKS
Eros

kryton9
01-02-2007, 01:42
Phenomenal boost in speed. Absolutely Amazing!!! Once I learn more I will really need to look into optimizing, what a difference. I always think on modern computers it doesn't really matter anymore, well another time I wrong again :)

Now I will play even more with this program as it is fascinating. You can almost start to visualize what is going to happen after awhile with the formulas, what a wonderful educational value and fun. It would have kept me awake in math class at school if we had stuff like this, instead of slide rules, although I thought the slide rule was cool at the time.