slow drawing
BlitzMax Forums/BlitzMax Programming/slow drawing
| ||
whenever I draw a few sprites that are about 200x200 pixels my program slows down, this is especially true for 200x200 sized particles where the game slows to a crawl. I tried switching the driver to opengl but the image masks become visible and I think its even slower. Is there a free alternative 2d engine? |
| ||
I'd say either your code is wrong, or you're drawing ALOT of particles :P |
| ||
Can you post a simple example code in order for us to help you find what's wrong? |
| ||
SetGraphicsDriver D3D7Max2DDriver () Graphics 640,480 wall=LoadImage("wallwood1.bmp") While Not KeyHit(KEY_ESCAPE) Delay(1) curTime =MilliSecs() If curTime > checkTime Then checkTime = curTime + 1000 curFPS = fpscounter fpscounter = 0 Else fpscounter = fpscounter + 1 End If 'SetBlend(LIGHTBLEND) Cls For x=1 To 10 For y=1 To 10 DrawImage wall,x*50,y*50 Next Next DrawText"FPS: "+curfps, 0,0 Flip False Wend End I get about 40FPS with directx and 33fps with openGL (I used an image that is 144x200) |
| ||
I get 332 FPS with DirectX and around 500 with OpenGL driver :P |
| ||
first: why do you have a delay in your loop? how fast is you computer? I get 330fps in debug mode with the delay and 555 without the delay in debug mode. I didn't even try it in release mode. |
| ||
Delay is to spare the CPU some I guess ;) |
| ||
I have the delay to return processing power back to the OS. Ive got a 2.5GHZ processor and a 64MB intel graphics card the PC is about 5 years old but enough to draw those images I would hope. |
| ||
Try removing the Delay(1) for starters. |
| ||
I think your graphics card is the cause of your problem. you need a more capable card. trash it and get a newer one :) |
| ||
I just tried irrlicht for 2d and its just as slow(!) |
| ||
341 FPS on my computer... When you say "64MB intel graphics card", do you mean "integrated video adapter with 64MB of shared memory"? If so -- those are dead slow. |
| ||
shame, sprite candy could probably handle it |
| ||
If B3D (SpriteCandy) runs faster, you're having a problem with OpenGL. I guess your OpenGL driver isn't worth it's name or -worse- OpenGL runs in sofware emulation mode. Try to update it or use "Setgraphicsdriver DX3D7Max2DDriver()" to force Blitzmax to use DirectX and see if that helps. You can't blame the software if drivers and/or hardware are crap... |
| ||
BM needs a 3D card as does Blitz3D with Sprite Candy ... sadly you have a 2D card (intel still tells different, its feature table as well. but features with no acceptable performance are kind of pointless) and that makes it hard to do that kind of stuff ... on an intel it might even fallback to microsoft 1.1 opengl emulation |
| ||
@Dreamora: My office PC has a Intel GM965 and it performs quite well with Blitzmax. But I had to install OpenGL drivers, they don't came with the box. |
| ||
Only till you come up with the idea to do particles or something else that does a fair amount of overdraw ... then the low bandwidth CPU to VGA/DVI adapter from intel will die and if not directly due to the bandwidth then because it does not have any usefull / performant alpha early drop mechanism as ATI / NVIDIA for 2+ generations now. |
| ||
200x200 is pretty big for particles or sprites. Especially on older machines. Try using a much smaller size. |
| ||
thank ill give it a try |
| ||
blitzmax is very slow better use irrlicht |
| ||
blitzmax is very slow You dug up a 7 month old thread just to satisfy your urge for a spot of Blitzmax hatemongering?better use irrlicht What's the point? Go away if you don't like it. |
| ||
Blitzmax is quite fast at 2d if youre using a decent/recent system. |
| ||
There is nothing in bmax to make it faster or slower than any other raw "2d via 3d" system. You're at the mercy of the DX7 , OGL driver. Plain and simple.... |
| ||
blitzmax is very slow better use irrlicht Given that - according to this thread ( http://www.blitzbasic.com/Community/posts.php?topic=63890 ) - you've spent a year waiting for an answer on how to make "matriced terrain", I'm not entirely convinced that your experience with Irrlicht is extensive enough for me to consider you an authority on the subject. I also wonder whether - given your predicament - you really want to be throwing stones with "slow" written on them. |
| ||
There is nothing in bmax to make it faster or slower than any other raw "2d via 3d" system. You're at the mercy of the DX7 , OGL driver. Plain and simple.... ^ What he said. And you are certainly few on that opinion, K@li. |
| ||
i did a test with Irrlicht and it was a lot slower than blitzmax for 2d |
| ||
a simple tile engine was 1000% faster in irrlicht (using 2d commands) than blitzmax 1.30 !!! Tested ! ps : il like blitzmax for the rad system but the graphical engine is poor in execution time i tryed irrlicht in C++ (veru butiful engine) and contunu to work with in blitzmax |
| ||
^ The jist of it: learn English.. BTW the delay call has almost no effect on the speed of the application, it just insures your computer doesn't become unresponsive. |
| ||
"a simple tile engine was 1000% faster in irrlicht (using 2d commands) than blitzmax 1.30 !!!" I'd say that was your fault, not Bmax. ;) |
| ||
??? the SAME engine, only replaced the DRAW command by DrawRect (irrlicht drax command) and.......... hop !! 1000% gain !!!! (twice in Directx mode) AND you ask this is not the fault of BLitzmax 2d engine ???? Please, test before speak. |
| ||
Could you post the source and the .exe for both versions so we can test them? Thanks! |
| ||
I'd be interested to see the Bmax source as well. |
| ||
Let's keep in mind Irrlicht does not support DX7 rendering. It uses DX8, DX9, OGL. (Plus software rendering fall back support.) Dx8 and especially Dx9 is faster than DX7, which is what BMax uses. So in that respect, sure there will be a speed increase. |
| ||
DX9 is used, yes. the finality, is to have a engine fastest as possible (300fps irrlicht) 30 fps blitz (!) understand that i find Blitzmax VERY POWEFULL but as a poor (OLD of course) graphic engine why no upgrade th blitz engine to DX9 ? |
| ||
Please, test before speak. Sure. Please provide the test, and I will. |
| ||
I got something in the region of 830fps. If that's not quick enough then I guess we've got big problems ;) |
| ||
aprox. 330 with delay(1) aprox. 660 without delay(1) aprox. 510 with delay(1) - GLMax2DDriver() aprox. 2500 (!!) without delay(1) - GLMax2DDriver() nv 8800 gts, Q6600, xp32 |
| ||
Taking out the delay I get between 2800 and 3100 fps. |
| ||
aprox. 330 with delay(1) o.O aprox. 660 without delay(1) aprox. 510 with delay(1) - GLMax2DDriver() aprox. 2500 (!!) without delay(1) - GLMax2DDriver() |
| ||
Ooh, scratch that, was a debug build. Take that out and I'm getting something in the region of 3400 now ;) I <3 my Mac :) |
| ||
240 DX -delay 300 DX -no delay 490 OGL -delay 1170 OGL -no delay 1 millisecond.. I guess I was wrong! |
| ||
What test are you guys using?!?! |
| ||
The short code from Jeremy some postings above :) |
| ||
I'd take a guess at 'Jeremy Paxman - Yeeeeeeeees 's original code. |
| ||
Delay ----- 969 fps in dx. 986 fps in opengl. No Delay -------- 3057 fps in dx. 2983 fps in opengl. |
| ||
That test is useless. Here's a more useful blit test, complete with layers and alpha.SetGraphicsDriver D3D7Max2DDriver () ' Graphics 640,480 ' wall=LoadImage("tile.jpg") ' make sure it's a solid 32x32 tile ' While Not KeyHit(KEY_ESCAPE) Delay(1) curTime =MilliSecs() If curTime > checkTime Then checkTime = curTime + 1000 curFPS = fpscounter fpscounter = 0 Else fpscounter = fpscounter + 1 End If SetBlend(ALPHABLEND) Cls For layerstested = 1 To 10 SetAlpha(.5) For x=0 To 19 For y=0 To 14 DrawImage wall,(layerstested*3) + (x*32),(layerstested*3) + y*32 Next Next Next DrawText"FPS: "+curfps, 0,0 Flip(0) ' False Wend ' End |
| ||
a simple tile engine was 1000% faster in irrlicht (using 2d commands) than blitzmax 1.30 !!! Learn how to code a simple tile engine properly in blitzmax then. |