View Full Version : TBGL Sprites - Please test this
Michael Hartlef
21-02-2009, 16:26
Hi folks,
I'm helping Petr right now by implementing sprites into TBGL. It would be great of you could let the attached sample run and let me know what frame rate you got and your system specs. On the notebook of my wife (Windows Vista, GF8600M GS) the window was strangely flashing, even when Vsync was on. I think there it is a driver problem as in my virtual XP system and on my sons XP system everything runs fine.
I got 1300 FPs on my IMac and around 820 on my sons desktop which has an old ATI X700 running with an Intel 2.8 GHZ cpu. My wifes notebook has a 3.0 Intel CPU and gets only 920 FPS. Or 30 if VSync is turned on.
So let me know your results and especially if you run VISTA, if it flashes for you too!
Thanks
Michael
Petr Schreiber
21-02-2009, 17:35
Hi Mike,
2600 fps on GeForce 9500GT.
Only flash which occures is changing background from green to red here, but I guess that is way to visualize whether collision occured.
Petr
Hi Michael,
i got 719 - 720 frames !
I saw no transparent colour !
I have Windows XP here.
Petr Schreiber
21-02-2009, 17:44
Peter,
no transparent colour is ok in this example, as it is not enabled for this script.
What is your graphic card if I can ask?
Petr
my card is a GeForce 8400 gs nvidia.
Michael Hartlef
21-02-2009, 19:55
Thanks folks. Petr you are damn right on everything. 2600 FPS, :unguee: :eusadance:
But the flashing included the sprites too, so there seems to be a driver problem on my wifes comp.
Petr Schreiber
21-02-2009, 21:18
Mike,
we have laptop with Vista at home too. It is not directly in my radius of infulence :D, but I can make tests on it.
It has ATi HD 3200 card.
Does your wife PC have drivers from Microsoft or NVIDIA?
Petr
Michael Hartlef
21-02-2009, 21:21
These are the Acer drivers from 1 year ago. I should get newer once as I saw that NVidia now supports mobile chips again.
Michael Clease
21-02-2009, 21:53
I'm getting about 3100 fps :eusadance: on my main computer.
ps. the new commands look interesting TBGL_Spritesetfriction ???
Michael Hartlef
21-02-2009, 22:43
Aaaah a module hacker :D
TBGL_SpriteSetFriction??? Never heard about this. This is only in your dream.
Intercom: Agent Red, we have someone who knows to much..... zzzzzztt
Agent Red: ok, not for long.... I'll take care of this..... zzzzzztttt
Joke aside: You can set speed values to sprites, which then will be moving automatically when you call certain commands. And the friction reduces these speed factors. Kinda a simply try to introduce a little physic here. But nothing major or big sience. And it is optional. No need to use it if you don't like it.
And now about 3100 fps. You gotta be kidding me. Are you running thinBasic on a blade server or some other secret technology from the next century? WOW!
MouseTrap
21-02-2009, 23:22
I ran the test.
The title bar framerate is 7500 but fraps gives me '9999'
I scaled the image to my fullscreen (1600x1200) and got:
titlebar gives me '2700' and fraps gives me '7800'.
I trust fraps.
If the sprites were supossed to be masked or alphablended, i didnt see it.
Petr Schreiber
21-02-2009, 23:39
Hi MouseTrap,
I was afraid what GTX monster will give :D
It is possible Fraps uses less precise measurement of FPS with 9999 set as "temporary limit".
Regarding alpha masking - as was said earlier, it is not enabled in this demo.
Mike! Mike! Mike! ( Clease ). How could you beat my new GeForce 9 with your GeForce 6 ... before I go to cry in corner, I will just say it seems investing money in high end seems to be good step after all :)
Petr
Michael Clease
21-02-2009, 23:49
Here is my proof and I wont ask to many question but are you just doing BB collision or is a collision mask/map involved.
I used PEid and did a search for strings on the .dll, a tool no respectable programmer should be without.
take thincore.dll its protected with ACProtect 1.3x - 1.4x DLL -> Risco Software Inc. *
Michael Hartlef
22-02-2009, 00:14
So far there is BB2BB, BB2Circle and Circle2Circle collision detection. The BBox is a rotated one. Thanks to Petr for that part of the code. If anyone has resources for a mask kind of collision detection in Opengl, then let me know. that is what I would like to implement too but don't know how.
MouseTrap
22-02-2009, 00:24
It is possible Fraps uses less precise measurement of FPS with 9999 set as "temporary limit".
Fraps is very accurate, but it uses a short moving average for blending.
I tried another test with my 2d renderer.
opengl on an empty scene gives me 9999
directX7 on an empty scene gives me around 3500
in the opengl scene i progressively add in primitive drawing calls until the framerate starts breaking below 9999.
I think its correct.
I tried to test with my own framerate function but i guess tb doesnt have a milliseconds type function.
ErosOlmi
22-02-2009, 00:31
I tried to test with my own framerate function but i guess tb doesnt have a milliseconds type function.
For Milliseconds: GetTickCount (http://www.thinbasic.com/public/products/thinBasic/help/html/gettickcount.htm)
For Microseconds: HiResTimer_Init (http://www.thinbasic.com/public/products/thinBasic/help/html/hirestimer_init.htm), HiResTimer_Get (http://www.thinbasic.com/public/products/thinBasic/help/html/hirestimer_get.htm), HiResTimer_Delta (http://www.thinbasic.com/public/products/thinBasic/help/html/hirestimer_delta.htm)
MouseTrap
22-02-2009, 00:41
Thanks!
i couldn't find it because searching for milliseconds in the docs return no results although its in the description.
Michael Clease
22-02-2009, 00:52
So far there is BB2BB, BB2Circle and Circle2Circle collision detection. The BBox is a rotated one. Thanks to Petr for that part of the code. If anyone has resources for a mask kind of collision detection in Opengl, then let me know. that is what I would like to implement too but don't know how.
Nice work.
I was thinking back to my amiga days and the blitter chip could take data from more than one source and do logical operations and then return a flag if the the data overlapped (if my brain remembers correctly), Opengl does have a logical function but I dont think it works in the same way.
It works fine in Vista here, I was getting around 405 FPS from my Intel card. :zzz:
Petr Schreiber
22-02-2009, 08:25
MichaelClease,
I heard some people use this approach in OpenGL via simplified masks and blending.
Maybe each pixel in sprite could be internally represented as little square, so we could do some early test first and then test square2square... we will see, thanks for bringing the logical op idea!
MouseTrap - millisecond precision is not enough for measuring FPS - take your 7500 fps:
1 second / 7500 fps = 0.00013333 seconds.
HiResTimer is our best friend :)
Petr
P.S. Matthew, I think 405 fps is very good for Intel card
Michael Clease
22-02-2009, 11:38
Just tested my laptop and I am getting 500-520 fps but the background colour in the window flickers all the time.
ErosOlmi
22-02-2009, 11:45
If I'm not wrong, background color is red when moving sprite is over fixed sprite.
Just to give the idea of collision.
Michael Clease
22-02-2009, 12:44
no it looks different to my main desktop, its like a bad framerate issue but at 500 its not.
ErosOlmi
22-02-2009, 13:21
I found an interesting articles on collision. Even if it is about another library it seem interesting:
http://www.compuphase.com/anicollide.htm
Also Google Groups can be a nice source of info:
http://groups.google.com/groups/search?q=%2Bsprite+%2B%22collision+detection%22&sitesearch=
Hi all,
tried on my laptop pc with vista and I have around 770 - 790 fps but also the background color flickers (Like Michael Clease).
Simone
Lionheart008
25-02-2009, 12:31
hi michael, hi all:)
yes, I can agree some properties of the background behaviours of your script other posts here... my fps rate (notbook, win xp, amd processor, nvidia 440 mx card (uargh), very old one) takes 655 until 665 and the color flickering (red, green, blue) is also present... but I like this little aeroplane ping-ponging through the scene;)
good luck for more, bye, Lionheart
Petr Schreiber
25-02-2009, 16:33
Thanks for the test Frank,
the background color change is feature, indicator of collision.
Petr