Blitzmax 2D Sprite Render Benchmark
BlitzMax Forums/BlitzMax Programming/Blitzmax 2D Sprite Render Benchmark
| ||
I'm hoping we can get enough responses from various cpu/gpu combinations to see the good and the bad. I'm posting this because GreyAlien has me a little nervous that some GPU's may be rendering DX7 very slowly. Perhaps if we get enough data we can find out a pattern of slow rendering from a specific configuration. Please download from here: http://jgoware.com/mge/bmaxtest.exe Run it in full screen and window mode, and post your specs along with the frame rate here, thanks. You can press "V" during the demo to force VSYNC. But you should let it run without vsync for speed tests. The demo renders 2000 sprites (random alpha and blend mode), draws some lines, clears the screen, uses Drawtext for fps display. So there's enough typical 2dmax features to make it worth while for benchmarking. My results: CPU: Intel Celeron 2.9ghz GPU: Intel 82845G Window: 29fps Full Screen: 30fps CPU: Intel 2300 1.66 Ghz GPU: Intel Mobile 945GM Window: 54fps Full Screen: 82fps SuperStrict ' ' Basic Blitzmax Noob Sprite Demo By "MGE" ' Incbin "tile.png" ' Const howmany:Int = 2000 ' <<<<<< Change this value for how many ' Global sprites:TSprite[howmany] ' Create an array of the type "TSprite" Global MyImage:Timage = LoadAnimImage:TImage( "Incbin::tile.png",32,32,0,64,FILTEREDIMAGE | MIPMAPPEDIMAGE) Global fps:Int ' used to display the frames per second Global fpstotal:Int ' counts how many frames rendered in 1000ms (1 second) Global ms:Float ' var to keep track if 1000ms (1 sec) has passed Global ms_start:Float ' var holds the beginning ms value at top of loop Global delta:Float ' simple delta time var. Different between start and end in loop. ' Type TSprite Field x:Float,y:Float Field xdir:Float,ydir:Float Field alfa:Float Field blendtype:Int Field tile:Int ' Method init() x = Rand(100,700) y = Rand(100,500) xdir = Rnd(-.2,.2) ydir = Rnd(-.2,.2) tile=Rand(0,63) If Rand(0,100)>50 blendtype = ALPHABLEND Else blendtype = LIGHTBLEND EndIf alfa = Rnd(.1,1) End Method ' Method update() x=x+(xdir*delta) y=y+(ydir*delta) If x>800 Or x<0 xdir=-xdir x=x+xdir EndIf If y>600 Or y<0 ydir=-ydir y=y+ydir EndIf ' End Method ' Method render() SetAlpha alfa SetBlend blendtype DrawImage MyImage:Timage,x,y,tile End Method ' End Type ' SetGraphicsDriver D3D7Max2DDriver() ' FlushKeys() FlushMouse() ' If Confirm("FULL SCREEN?")= True Graphics(800,600,32,60) ' width, height, depth (16,32, 0=windowed), hz Else Graphics(800,600,0,60) ' width, height, depth (16,32, 0=windowed), hz EndIf ' For Local c:Int = 0 To howmany-1 ' arrays start at 0 so we go to total - 1 sprites[c] = New TSprite ' fill our array with our object type sprites[c].init ' call the Object's init routine to set up the sprite Next ' HideMouse() FlushKeys() FlushMouse() ' resetstates() ' reset render states ms = MilliSecs() ' get the current 1000ms clock ' Repeat ' ms_start=MilliSecs() ' Cls ' SetColor(255,0,0) Local x1:Int=0,y1:Int=0,x2:Int=799,y2:Int=599 For Local c:Int=1 To 10 DrawLine x1,y1,x2,y1 DrawLine x2,y1,x2,y2 DrawLine x2,y2,x1,y2 DrawLine x1,y2,x1,y1 x1=x1+20 y1=y1+20 x2=x2-20 y2=y2-20 Next ' SetColor(255,255,255) ' For Local obj:TSprite = EachIn sprites ' cycle through all objects in array obj.update ' Call the "update" method to update sprite's position. obj.render ' Call the "render" method to display the sprite. Next ' resetstates() DrawText "FPS: "+fps,0,0 ' Display how fast the program is running. If KeyDown(KEY_V) Flip(1) ' Flip(1) for vsync, Flip(0) for full speed Else Flip(0) EndIf delta = MilliSecs() - ms_start ' Computer delta, start time - end time of loop ' DoFPS() ' Keep track of how many frames per second ' Until KeyHit(KEY_ESCAPE) ' Press ESC to exit ' ShowMouse() EndGraphics() ' Close down graphics device End ' Still need docs on this command. ' Function resetstates() ' Reset render states SetColor(255,255,255) SetAlpha(1) SetBlend(ALPHABLEND) SetTransform 0,1,1 End Function ' Function DoFPS() ' Inc frames, and track if 1 sec has passed fpstotal = fpstotal + 1 If MilliSecs()>ms fps = fpstotal fpstotal = 0 ms = MilliSecs() + 1000 EndIf End Function |
| ||
Can you upload tile.png? Then I can run this test with the DX9 graphics driver, and OpenGL, to compare with my shoddy DX7 performance. |
| ||
Well...we know the DX9 driver will be faster on your system. :) What we need to stablize on is if it's just your card on your system or if there is a stable problem with the card & driver. And if that turns out to be true, then the next step is to see how wide spread with other cpu/gpu's the problem is. ;)![]() |
| ||
hmm.. actually I'd like to test the DX9 version as well. :) Upload the .exe when you can. (IncBin the tile too please.) Thanks! |
| ||
CPU: AMD Athlon XP (2.1 ghz) GPU: GForce FX 5700 (256 MB) Window: 110fps Full Screen: 130fps |
| ||
Hi MGE, here are my results. BTW, do you still plan to release your game engine at some point? I remember it was looking neat in the demos that you posted before. Jason. CPU : Athlon 1800+ (1.54ghz) GPU : GeForce4 TI 4600 (128mb) Windowed : 104 FPS FullScreen : 110 FPS |
| ||
OK here's a DX7/DX9/OGL version: http://www.greyaliengames.com/misc/spritetest.zip (598Kb) Here's my results on my Radeon HD 2600XT 512MB GDDR3: Only tested in windowed mode (full-screen is basically the same): DX7: 19 FPS DX9: 85 FPS OGL: 101 FPS Don't forget that DX7 is always slower than OGL in BMax because of the "lag fix" that was added a couple of years back. The fix *IS* required though. However, my new card just seems really WAY too slow. It shouldn't be slower than an old 9800XT should it? |
| ||
tested on my work machine: Athlon 64 X2 5000+ 256MB Radeon X1300Pro full screen: 201FPS |
| ||
Fullscreen: DX7 - 255 FPS DX9 - 135 FPS OGL - 388 FPS Windowed: DX7 - 245 FPS DX9 - 135 FPS OGL - 387 FPS NVIDIA Geforce 8800 GTS 640 MB (513 MHz Core, 792 MHz Ram, Driver 175.19) |
| ||
"Don't forget that DX7 is always slower than OGL in BMax because of the "lag fix" that was added a couple of years back." Weird how sometimes Dx7 is faster than Ogl on my dev system. Seems the more sprites rendered, the more it favors dx7. The Dx9 driver should be faster. That's a given. ;) But more importantly we're still looking for someone who has the same new card as GA which is: Radeon HD 2600XT 512MB GDDR3 If we get similar slow results, then we know it's the card for sure. |
| ||
The Dx9 driver should be faster. That's a given. ;) Why should it be? Doesn't it just have more features? It's true that having the lag fixed removed will speed it up but is there any other reason is should be faster? |
| ||
Improvements in the directx pipeline, low level code, etc. From the info I've gathered, DX9 is a fairly big improvement over Dx7 where as the jump from dx7 to dx8 wasn't as great. Just wait till someone writes support for the Dx9 Sprite Object. It will be even faster. ;) But take a look at robobimbo's results. ? |
| ||
OK thx for clarifying. wow interesting results from robobimbo! I'm trying to remember if the lag fix was only required for Flip 1 anyway...it's been a while... |
| ||
Fullscreen: DX7 - 230 FPS DX9 - 130 FPS OGL - 330 FPS Windowed: DX7 - 230 FPS DX9 - 130 FPS OGL - 330 FPS Geforce 8600 GTS. |
| ||
DX7 - 17 FPS DX9 - 13 FPS OGL - 13 FPS Intel 945 |
| ||
Full screen: DX9 - 141FPS DX7 - 185FPS OGL - 225FPS Windowed: DX9 - 142FPS DX7 - 178FPS OGL - 210FPS NVIDIA 9600 GT |
| ||
Full screen: DX7 - 120 FPS DX9 - 83 FPS OGL - 145 FPS Windowed: DX7 - 116 FPS DX9 - 82 FPS OGL - 136 FPS Ati Radeon X1600 |
| ||
Jake, are you sure you have this new card configured correctly? Even in OpenGL, your card is producing barely 30% of the speed of mine, and the cards should be broadly similar performance wise. |
| ||
@Gabriel: Hmm interesting. There's a whole thread about my new card in the General Discussion forum, but basically it's had a clean install and I've tried the drivers from the CD, the latest Radeon drivers and some hotfix drivers, all give the same result. Wonder if my P4 3.2GHz (single core) CPU could be bottlenecking somehow? Also it's AGP, but my board is AGP 8x and ran the 9800XT fine, and the X1950 fine (although that one occasionally hung). |
| ||
There's a whole thread about my new card in the General Discussion forum but in that thread you told everybody your OGL and DX9 were OK. In fact, they are awful. That does mean some of the suggestions might be valid. |
| ||
512MB Geforce 8500GT: (very cheap budget card ~£20) Full screen: DX9 - 97 FPS DX7 - 324 FPS OGL - 325 FPS Windowed: DX9 - 91 FPS DX7 - 262 FPS OGL - 297 FPS Grey, something's wrong cos that's terrible! |
| ||
Windowed: DX9 - 124 FPS DX7 - 284 FPS OGL - 241 FPS |
| ||
Full Screen: Dx7 200 Dx9 120 Ogl 200 Windowed: Dx7 160 Dx9 120 Ogl 200 Athlon 3000+ 2G N6800 128MB |
| ||
Full screen - 133 Windowed - 126 ATI Radeon 9800 256Mb AMD Athlon 3400+ 1Gb |
| ||
Result from another machine of mine. FS: Dx7 28 Dx9 120 Ogl 120 Windowed: Dx7 28 Dx9 120 Ogl 200 Athlon 4000+ 2G ATI HD2600pro , just similar to GA's. (so is the awful result) |
| ||
but in that thread you told everybody your OGL and DX9 were OK. In fact, they are awful. That does mean some of the suggestions might be valid. I tried everything in that that thread though. Wasted an entire day (and thus an entire day's pay) trying to sort it out.@Tommo: At last! Another similar card. Seems like you are getting very similar crappy results to mine. I guess your PC is faster than mine which part accounts for the improved framerate. So this finally proves that it's not just my card (unless you've made the same setup mistakes I have or something). One thing, is yours AGP or PCI-E and what is the card's RAM (256/512? and GDDR2/3/4?)? Thanks |
| ||
PCI-E 512MB DDR3. It gives higher benchmarks than my 6800 in 3Dmarks, but still far under my expctation. I think this should be driver issue, which might never get fixed. :-( Although, my girlfriend uses it, and she is not a game hardcore, so I didn't care much. |
| ||
I tested on three platforms: FullScreen/Window Mobile Intel 915 128MB (1024x768) DX7 73 / 67 DX9 49/49 Ogl 43/69 ATI Radeon XPress 200 128MB (1280x800) DX7 70/69 DX9 65/65 Ogl 90/90 GeForce 8600M GS 512MB (1440x900) DX7 121/100 DX9 220/110 Ogl 220/212 DX7 ist not really bad, but with the more modern 8600 DX9 looks quite better. |
| ||
My main box: Intel Core2 Quad Q6600 @2.40GHz, NVIDIA GeForce 9600 GT running Vista Ultimate (32bit) Driver: Windowed / Fullscreen DX7: 219/225 DX9: 132/228 OGL: 294/304 Laptop: Intel Core2 T7200 @2.00GHz, ATI MOBILITY FireGL V5200 running Vista Ultimate (64bit) Driver: Windowed / Fullscreen DX7: 159/157 DX9: 190/203 OGL: 171/184 |
| ||
On my PC (C2D 3.0Ghz, GeForce 8800GTS 640MB, under Vista SP1). Fullscreen / Windowed DX7: 336 / 312 DX9: 370 / 150 (!) OGL: 365 / 360 Wonder if my P4 3.2GHz (single core) CPU could be bottlenecking somehow? Quite possibly. About a year ago I built a new PC, but kept the graphics card (the GeForece 8800GTS 640MB used here), and the performance boost I got was about 2.5 to 3 times what it was previously. The CPU and the GPU have to be matched so that the CPU can feed the GPU fast enough for it to live to it's full potential. |
| ||
CPU: Athlon x2 4600+ GPU: 6600GT 128MB Driver: Windowed / Full Screen DX7 : 155 / 196 DX9 : 142 / 148 OGL : 273 / 301 Interestingly, my 6600GT beat Yahfree's 9600GT on most counts. And here was me thinking of getting a new card (albeit *not* a 9600GT!) |
| ||
![]() |
| ||
Nice Robo! Thanks!! Thanks for everyone contributing. The demo has alot of overdraw on purpose so it's good to see how the various gpu's respond to that. GA, I have to say, the good news is DX7 is alive and well. I did some research on your card and the good news is, that's not going to be anywhere close to a typical end user installation. Especially in the casual market. Where Nvidia and Intel have a vast superior percentage of installations. So, while it's very interesting that your new card is behaving poorly in Dx7 (still...why?!?!?!) , I feel much better knowing the problem isn't wide spread. ;) |
| ||
252 FPS fullscreen on the machine with specs in my sig |
| ||
those dx9 results have to be wrong.... all the testing I've done and still do show the dx9 driver doing better...? are you sure you didn't switch it around in the code? :) [edit] whoops, I just compile these against what I have. I was wrong.... I was thinkg of tests I'm running using a modified indiepath TAnimImage routine with dx9. with the example code above my dx9 is about the same as what Grey's exe gives me. |
| ||
CPU: Intel Q6600 GPU: nVidia 9600 Window: 201fps Full Screen: 212fps Using Grey's test (windowed/fullscreen): DX7: 217/217 fps DX9: 120/225 fps (I see the same on a few ppls - interesting result) OGL: 272/256 fps |
| ||
Full screen: ~319 Windowed: ~313 Grey's test (FS/W) DX7: ~329/~311 DX9: ~299/~159 GL: ~335/~339 |
| ||
Dx9 is capable of better performance. We won't really see that with Blitzmax because under the hood it's still the same bmax interface regardless of dx7 or dx9 driver. The real speed increase will happen in 1 of 2 ways... 1) Someone adds batching support to the dx7/dx9 drivers. 2) Someone adds support for the DX9 sprite object. That has support for rotation, x/y scaling, rgb modulation, texture batching, etc, all wrapped up in a nice easy to use high level call. I'd like to work on this in the future when I have time. |
| ||
Full Screen: 194 Windowed: 188 Grey Alien's DX9: Full screen: 138 Windowed: 135 OGL full screen: 192 Windows Vista x64, HIS X1650XT. So... Mine actually performs better under DX7, using ATI's latest drivers. |
| ||
Fullscreen: DX7 - 222 FPS DX9 - 94 FPS OGL - 224 FPS Windowed: DX7 - 207 FPS DX9 - 90 FPS OGL - 222 FPS Celeron E1200 1.6GHz, 4GB RAM, Geforce 8600GT 512MB |
| ||
Intel X3100 /Dualcore 1.6 Vista Fullscreen: DX7 - 11 FPS DX9 - 11 FPS OGL - error FPS Windowed: DX7 - 11 FPS DX9 - 11 FPS OGL - error FPS XPsp3 Fullscreen: DX7 - 24 FPS DX9 - 12 FPS OGL - 24 FPS Windowed: DX7 - 24 FPS DX9 - 14 FPS OGL - 24 FPS |
| ||
@Tommo: ok thanks. So it's the same as mine except it's PCI-E. @JazzieB: but I bet if I put my 9800XT back in I'd get some good results again. @robobimbo: On the chart the 2600XT DX7 and DX9 stats need to be swapped. The DX7 should be the 19FPS. @MGE: Yeah *EVERYONE* here has better performance than me! Seems like I need a new AGP card (or better PSU to run my X1950 instead...) It's interesting that some cards are better at DX7 than DX9 and others are better at DX9. Also some systems are way better at DX9 in full-screen mode than in windowed mode - but as most games will start in full-screen mode I think that's fine. |
| ||
@MGE: Yeah *EVERYONE* here has better performance than me! Have a look in the same thread on Indiegamer, where I posted my results last night! Could have posted them here too but didn't see a lot of point in it.Oh, and I tried your DX9 test - 2FPS less. Check the other results before you tell me that 2FPS is "nothing". ;) |
| ||
Yeah just saw that, ouch. Thing is my card is not much faster and it cost £50! |
| ||
256MB 7600GT: Driver:Fullscreen/windowed DX7:52/50 DX9:41/37 OGL:106/104 |
| ||
Athlon X2 6000+ Ati 2600pro (with 8.9 drivers) Vista Home Premium 32bit Full screen and windowed were both same fps.. dx7 180fps dx9 180fps Ogl 170fps |
| ||
So a 2600 that works fine, weird! I really want Plash to post now. @Finjogi: I assume your card is a PCI-E but how much RAM and what speed RAM please? |
| ||
DX7 -windowed: 10fps; fullscreen: 10fps DX9 -windowed: 84-90fps; fullscreen 90fps OGL -windowed: 140-144fps; fullscreen: solid 144fps Radeon HD 2600 XT According to http://www.systemrequirementslab.com my card has 512mb ram, according to Google some have 256, but I would imagine all are 800Mhz GDDR4. EDIT: And yes, I'm fairly certain I have the latest drivers. EDIT2: So a 2600 that works fine, weird! I really want Plash to post now. His is a different model.EDIT3: DX7: 19 FPS Woah, my DX is slightly slower but my GL is faster.. DX9: 85 FPS OGL: 101 FPS |
| ||
@Plash: thanks for testing! These cards have a real problem with DX7 on BMax. Have you noticed poor performance on any old DX7 games? Today when testing my game I noticed that even in OGL some jerks occur. His is a different model. Yes, a 2600 Pro, but further up Tommo has a 2600 Pro with similar crap results. So far all the XTs are crap and the Pros are split between crap and good.@Plash: is your card PCI-E or AGP? Btw, mine is GDDR3 and some are GDDR2 so yours may not be GDDR4 at all... |
| ||
is your card PCI-E or AGP? Btw, mine is GDDR3 and some are GDDR2 so yours may not be GDDR4 at all... PCI-E, I don't think there is a way for me to figure out what kind of ram my card has, I don't have the box (bought the card and mobo from my brother.) |
| ||
start/all programs/accessories/system tools/system information under components/display/adapter ram |
| ||
![]() It does not mention the type of ram it is, nor the speed. Latest ATI Catalyst is 8.9, but that is not the driver version. Assassins Creed runs quite smooth in DX9, with lv3 graphics (after the audio lag was fixed.) Looks like the driver is slightly newer then mine.. I'll post the fps' after the update. EDIT: (all tested in windowed and fullscreen, close enough to each other [or exactly the same] to not be mentioned) DX7 11fps DX9 110fps OGL 145-150fps |
| ||
Just out of curiosity I tried a comparison between Vista x64 and XP x86, Same computer and graphics card, different HDD and OS... XP x86: DRV | FULL | WINDOW | DX7 | 324FPS | 262FPS | DX9 | 97FPS | 91FPS | OGL | 325FPS | 297FPS | VISTA x64: DRV | FULL | WINDOW | DX7 | 195FPS | 174FPS | DX9 | 352FPS | 167FPS | OGL | 256FPS | 247FPS | Quite a difference! shame we don't have a dx10 driver, cough. |
| ||
@Grey Alien: PCI-E, 256Mb, mem clock is 680mhz, gddr3, core 600mhz.. this is so called noname card which was preinstalled, just plain Acer "supermarket" desktop computer.. 4Gigs main ram. (Edited mhz values..) |
| ||
@Plash, thanks for checking. Never mind. @Finjogi: OK thanks. Well glad your card works OK. Mine is a Sapphire card which is supposed to be good... |
| ||
I've tested again with the other drivers. CPU: AMD Athlon XP (2.1 ghz) GPU: GForce FX 5700 (256 MB) OS: Windows XP pro SP2 DRV | FS | WIN ----------------- DX7 | 140 | 120 DX9 | 100 | 100 OGL | 190 | 160 |
| ||
MGE can you email me the PNG please so I can see where the bottleneck is in the Dx9 Driver these numbers are way too slow. DStastny(at)comcast.net Thanks DStastny |
| ||
You should just be able to save the PNG that he posted above and use that, it's what I did :-) |
| ||
Thanks Grey, I saw that. Man am i having some brain farts this morning. Doug |
| ||
DX7 - 275 DX9 - 265 GL - 182 With 8xAA and 16xAF as im lazy and didnt turn them off. Vista 64bit Home Premium Intel Q9450 4gigs of ram Gainward ATI 4870 Golden Sample (sic) (using the first bios (it has 2)) |
| ||
Thanks Doug. ;) |
| ||
DX7 - 29 DX9 - 118 OGL - 129 CPU: athlon 64 X2 5000+ 2.6 GHz GPU: radeon HD 3200 IGP - (with 8.9 driver) OS: WinXP Home sp3 So, I'm getting the same results as the people with the 2600 cards. I can player newer dx9 games on this box but some of my older dx7 games like Motocross Madness2 and Crimson Skies crash on me. |
| ||
Interesting, another crappy dx7 performance ATI card here. I think Finjogi gets a good result with his 2600 because he is using vista, on which Dx7 is emulated. |
| ||
DX7 - 301 DX9 - 134 OGL - 253 CPU: athlon64 X2 4600+ (2.4 GHz) GPU: geforce 8800gts 640 mb (178.13) OS: WinXP home sp3 |
| ||
FS: DX7 - 90 DX9 - 135 OGL - 126 WIN: DX7 - 92 DX9 - 81 OGL - 97 Athlon 64 X2 5200+, 3GB, 256MB Radeon HD 3450+3200, Vista Premium 32 |
| ||
I feel sorry for B3D users, you know their games are going to crawl on some of those ATI cards. eek! |
| ||
CGV: Interesting to see another card with the same problems, thanks for posting. I think Finjogi gets a good result with his 2600 because he is using vista, on which Dx7 is emulated. AHA! A reasonable sounding explanation, cool.I've ordered a new PSU (700W) and I'm going back to my X1950 card that was occasionally crashing on my 460W PSU. It's a gamble that the PSU was the problem and not the card ... I'll find out soon. |
| ||
Otus: Any chance you could run the test again without hybrid crossfire. Test it once with just the 3200 to see if you get the same results as me, then test it again with just the 3450. I've read some reviews which suggest you get better results with just the 3450 alone. Of course you're using Vista which emulates DX7 support so that could skew the results. You wouldn't happen to have WinXP installed on that box, would you? :) |
| ||
CGV: Sorry, can't run with 3200 only. The IGP only has a DVI output and my monitor only has a VGA input. My experience with hybrid crossfire is that there's little performance gain, but significantly lower temperatures when doing normal desktop stuff. Here are the 3450 only results: FS: DX7 - 88 DX9 - 95 OGL - 127 WIN: DX7 - 80 DX9 - 82 OGL - 89 |
| ||
Okay, thanks Otus. My northbridge idles at 81 C so I may just try the hybrid option for that reason alone. |
| ||
OK I got myself a 700W decent PSU and plugged my Radeon X1950 Pro (AGP) back in and got these stats in windowed mode: DX7 - 177 DX9 - 99 OGL - 153 A *LOT* better. Let's hope this PSU and Gfx card work well together... |
| ||
windowed: DX7: ~275 DX9: ~200 OGL: ~263 fullscreen: DX7: ~301 DX9: 198 OGL: ~340 My system: mac pro 8core Intel(R)Xeon(R)CPU X5365 @ 3.00Ghz 2.99Ghz, 7.98GB of RAM XP Professional x64 Edition Version 2003 Service Pack 2 Chip:Nvidia Geforce 7300 GT DAC: Integrated RAMDAC mem: 256 Mb bios: Version 5.73.22.29.A1 NOW, the fps sound nice, but it doesn't perform well at all. Icons just jitter wildly all over the screen, not a single smooth motion in there at all. It basically looks like a total seizure of some kind. I've also tested it on a lowly 1.6Ghz laptop and had perfectly smooth motions of all of the tiles... very pretty, but what the heck is going on with the 8core? I have DX9(v9.6) installed, but it dawns on me, too, that it's not a GFX board issue at all... MGE was so kind to point out a potential problem with the Millisec() counter?! I'll try to do some tests and post them later... Thanks for doing all that! |
| ||
There's actually 2 things it "might" be. a) Problems with the millisecs() timer due to something perhaps with the x64 edition of XP Pro. b) Your system is rendering the frame so fast it's not registering a change in the millisecs() but your frame rate reporting would be off then as well since that is based off the millisecs() timer too. ? |
| ||
That sounds pretty good! HAHA! When I did my first millisecs tests, I was angry about the coarsness of them! I was hoping it was at floating point millisecs, hahaha, but I'm begin serious here. I really thought it should for the exact reason you're describing! (That's one of the rare things you've said, that somehow doesn't make me feel like an idiot, hahaha! I mean, like a confused noob rather. That was supposed to be against me, not you, pfff!) But no, really, is there any alternative to get to a timer of some sort? What kind of routine could give us access to a continuous beat at higher frequency, is there more to get out of the systemclock, anything else that repea.... i think you got it... now I'm hoping and thinking of where I could go search and dig... I firmly believe you're right with b)! I've made a little test code to see more casual millisec changes. On my machine here(8core) it is dead on what ever mild variances are happening, calmly stepping between 132 and 135. On the supersmooth stoneage laptop, this timer was on crouches, really. So speed or refresh-speed-lagging doesn't seem to be our problem at all! Here's my silly little tamed timereader... if I wasn't creating some delayed way of reading it it would be impossible to read any delta values! But I assume that's like that for everyone... |
| ||
Taron - try this and let me know if it still chokes...SuperStrict ' ' Basic Blitzmax Noob Sprite Demo By "MGE" ' Incbin "tile.png" ' Const howmany:Int = 2000 ' <<<<<< Change this value for how many ' Global sprites:TSprite[howmany] ' Create an array of the type "TSprite" Global MyImage:Timage = LoadAnimImage:TImage( "Incbin::tile.png",32,32,0,64,FILTEREDIMAGE | MIPMAPPEDIMAGE) Global fps:Int ' used to display the frames per second Global fpstotal:Int ' counts how many frames rendered in 1000ms (1 second) Global ms:Float ' var to keep track if 1000ms (1 sec) has passed Global ms_start:Float ' var holds the beginning ms value at top of loop Global delta:Float ' simple delta time var. Different between start and end in loop. ' Type TSprite Field x:Float,y:Float Field xdir:Float,ydir:Float Field alfa:Float Field blendtype:Int Field tile:Int ' Method init() x = Rand(100,700) y = Rand(100,500) xdir = Rnd(-.2,.2) ydir = Rnd(-.2,.2) tile=Rand(0,63) If Rand(0,100)>50 blendtype = ALPHABLEND Else blendtype = LIGHTBLEND EndIf alfa = Rnd(.1,1) End Method ' Method update() x=x+(xdir*delta) y=y+(ydir*delta) If x>800 Or x<0 xdir=-xdir x=x+xdir EndIf If y>600 Or y<0 ydir=-ydir y=y+ydir EndIf ' End Method ' Method render() SetAlpha alfa SetBlend blendtype DrawImage MyImage:Timage,x,y,tile End Method ' End Type ' SetGraphicsDriver D3D7Max2DDriver() ' FlushKeys() FlushMouse() ' If Confirm("FULL SCREEN?")= True Graphics(800,600,32,60) ' width, height, depth (16,32, 0=windowed), hz Else Graphics(800,600,0,60) ' width, height, depth (16,32, 0=windowed), hz EndIf ' For Local c:Int = 0 To howmany-1 ' arrays start at 0 so we go to total - 1 sprites[c] = New TSprite ' fill our array with our object type sprites[c].init ' call the Object's init routine to set up the sprite Next ' HideMouse() FlushKeys() FlushMouse() ' resetstates() ' reset render states ms = MilliSecs() ' get the current 1000ms clock ' Repeat ' ms_start=MilliSecs() ' Cls ' SetColor(255,0,0) Local x1:Int=0,y1:Int=0,x2:Int=799,y2:Int=599 For Local c:Int=1 To 10 DrawLine x1,y1,x2,y1 DrawLine x2,y1,x2,y2 DrawLine x2,y2,x1,y2 DrawLine x1,y2,x1,y1 x1=x1+20 y1=y1+20 x2=x2-20 y2=y2-20 Next ' SetColor(255,255,255) ' For Local obj:TSprite = EachIn sprites ' cycle through all objects in array obj.update ' Call the "update" method to update sprite's position. obj.render ' Call the "render" method to display the sprite. Next ' resetstates() DrawText "FPS: "+fps,0,0 ' Display how fast the program is running. If KeyDown(KEY_V) Flip(1) ' Flip(1) for vsync, Flip(0) for full speed Else Flip(0) EndIf ' Repeat Until MilliSecs() > ms_start ' delta = MilliSecs() - ms_start ' Computer delta, start time - end time of loop ' DoFPS() ' Keep track of how many frames per second ' Until KeyHit(KEY_ESCAPE) ' Press ESC to exit ' ShowMouse() EndGraphics() ' Close down graphics device End ' Still need docs on this command. ' Function resetstates() ' Reset render states SetColor(255,255,255) SetAlpha(1) SetBlend(ALPHABLEND) SetTransform 0,1,1 End Function ' Function DoFPS() ' Inc frames, and track if 1 sec has passed fpstotal = fpstotal + 1 If MilliSecs()>ms fps = fpstotal fpstotal = 0 ms = MilliSecs() + 1000 EndIf End Function |
| ||
fullscreen: ~165 windowed: 144 (solid) Looks still a little choppy, but MUCH better! Almost forgot to post my little snapshot from the millisec test... ![]() |
| ||
Question.... In your advanced 3d settings on your GPU control panel, do you by any chance have "VSYNC Disabled" or "VSYNC always off" or something similar? Because if you do...that would explain..sooo much. :) |
| ||
I have it controlled by the application! |
| ||
errr.. !@#$% I was hoping for a fluke which would explain everything. shit. |
| ||
LOL... Well, I wrote a little routine that's unbelievably smooth on my machine and fun to look at...it uses openGL, however. You'll see... I made it a little more convenient as well, haha. Vertical Blank on this sits at 100% 60fps when windowed and 61fps in fullscreen... (?!? haha, but still smooth!) Without VB it bounces around 950 fps, haha! (108 Balls) With 2000 balls it goes down to around 234 fps, but VB remains solid 60fps. |
| ||
that's a very nice "light" effect.... you had me fooled for a just second, nice job! |
| ||
Hehehe...thanks! Check out the version I posted in the BlitzShowcase thread... Anyway, I also posted something there, which I probably should rather post here: - I noticed a fundamental problem with Bmax's Timers and delay functions, since neither of them can deal with fractional millisecs, resulting in totally unreliable Hz results. 60 fps means 16.666~ millisecs per frame. No way to get that, in case the vertical blank can't be used (like it appears to be on gfx boards like: Mobile Intel - Extreme Chipset) Well, I did have a funny idea and it may be interesting at some point, but it would almost require to take care of all the cycles in the loop. I measured (approximately) the amount of increments that would happen inside of one millisecond. Then I took that number by how ever many fractional millisecs I want to wait and somehow needed to take it times 2, but ended up incredibly close to what I wanted. This precision then showed the trouble of having to take in account what else would happen within the loops in terms of operations. I think that's a little on the insane side and frankly believe it's something BlitzMakers should consider "fixing". There must be a better alternative to get a finer timer for such fractional millisecs. Or much rather, is there no way to forcefully aquire vertical blank triggers of GFX boards? |
| ||
Oh...and...the problem may well be with MaxGui, though. When it opens a window, maybe it does it in some way where the vertical blank can't be received? |
| ||
why do you need higher resolution? over the last few years there have been tons of discussions on timing issues and resolution of them on the forums. here is some tweening code... http://www.blitzbasic.com/Community/posts.php?topic=80553#906721 and one by HrdNutz http://www.blitzbasic.com/codearcs/codearcs.php?code=2039 I stand by tweening as the best solution but others swear by delta timing. the tweening examples work great on the intel based boards I've tested. the code also works great with MaxGUI windows. using tweening and not waiting for vwait gives the best results all around with little effort once it's understood. |
| ||
Hey dmaz, I figured most of my problems out and am rather happy right now. Turns out that the vertical blank problem was openGL related in my MaxGui compiles. Using dx has prooven to work very well and currently my stuff runs supersmooth... YAY! Check out the latest space thingy...in case you havn't seen it yet?! [a]http://www.blitzbasic.com/Community/posts.php?topic=81390[/a] No tweening, nothing fancy, just a good old fashioned vb flip. Should trouble arise, I might look at tweening again, too. I can't believe it took me until now to get this under somewhat of a control...crazy. Thanks, though! |