very nice.
I reached 100 balls at 12 FPS
A good example to use for testing Core optimization.
Beautiful
Hi,
Jordi Valles on PB forum posted very nice 2D demo of kind of sphere physics.
I ported it to ThinBasic, with pseudo 3D look ( calculations are still 2D ).
It is pretty computionally intensive.
How many sphere does your PC manage? I am reaching smoothness limit around 50. This could serve as interesting benchmark for optimizing raw ThinBasic parsing speed
How to use:
- Click in the gray box to add spheres
- Right-Click in the gray box to remove last sphere
- Watch timing in window title
Bye,
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
very nice.
I reached 100 balls at 12 FPS
A good example to use for testing Core optimization.
Beautiful
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Nice example. 85 spheres at 12 FPS.
I filled the box up around 79 balls and when I clicked to drop a ball it would say 14fps and then read 30 fps after that.
Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server
This is an interesting problem for collision detection - its a bit like a sort algorithmn. If you change the inner collision loop to:
for i = j+1 to nBalls
instead of:
for i=1 to nBalls
then you should double the performance
at 150 balls it went from 5fps to 10fps on my PC.
We are still faced with the processing time increasing as the square of the number of balls of course but the number of comparisons has now halved.
Thanks Charles,
you are right! I can now get 81 spheres at 25FPS.
Great trick!
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Here is an Oxygenated version. - I have put the inner collision detector loop into assembler and get a steady 34 fps all the way up to 200 balls.
But see how they quarrel and fight each other when the container gets too full! You would not want to be in there with them.
PS latest version with slimmer code. (better use of registers)
200 balls at 100 FPS !
The power of machine code.
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Wow ;D
Here comes slightly modified version, based on Oxygenized one:
- You can choose 2 sphere detail levels
- Bigger box
- More spheres allowed
- You can spawn objects by holding space and moving mouse
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
800 speres at 35 FPS here. Big improve. Impressive.
If it would be possible to develop some TBGL internals on collision detection I think all TBGL scripts would improve a lot.
But I know it is big job maybe not worth right now.
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Bookmarks