HW image version of this little stupid thing - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10) +---- Thread: HW image version of this little stupid thing (/showthread.php?tid=1991) |
RE: HW image version of this little stupid thing - grymmjack - 09-12-2023 (09-12-2023, 01:53 PM)TerryRitchie Wrote:(09-12-2023, 01:45 AM)bplus Wrote: I never worked with Hardware images the Wiki for _copyimage didn't show an example in my quick scan. Looking forward to that day @TerryRitchie RE: HW image version of this little stupid thing - grymmjack - 09-12-2023 (09-12-2023, 07:11 PM)TerryRitchie Wrote: It's well worth learning to use hardware images. Here is a little demo I just wrote showing the power of hardware images. This program creates 8000 sprites and then let's the user switch between software and hardware mode to see the performance difference. I'm going to start creating demos for a lesson on hardware vs software images in the tutorial. It's long overdue. ...and the day has come @TerryRitchie this is a FANTASTIC example and we should put this in the damned wiki. I wish the forum had some way to mark posts as notable or something and then a way to just see them in a list. Thanks Terry! RE: HW image version of this little stupid thing - grymmjack - 09-12-2023 (09-12-2023, 09:46 PM)SMcNeill Wrote: Try this little demo to showcase the difference in speed between Hardware Images and Software Images: Thanks @SMcNeill I was getting almost similar results. 80,000 or so in hardware and 80-90 in software. This is on a 8 year old macbook pro from 2015. RE: HW image version of this little stupid thing - a740g - 09-12-2023 (09-12-2023, 10:54 PM)grymmjack Wrote:The `_CLEARCOLOR` is for the sprite transparency. I removed the `_DISPLAYORDER _HARDWARE` line. `_DISPLAYORDER _HARDWARE` will render hardware surfaces only. So, basically `CLS , _RGB32(0, 0, 255)` had no effect with that line.(09-12-2023, 01:21 PM)a740g Wrote: Made a few changes. RE: HW image version of this little stupid thing - NakedApe - 09-13-2023 Very cool demo, Terry! What a difference using hardware images. I'm on an M1 Mac Mini and I cranked the sprite total up to 20,000. The program ran fine @ 7 FPS software and ~500 FPS hardware, though the hardware speed jumped back'n'forth from 1000 to 500 constantly. This will come in handy for the game I'm working on... Thanks! RE: HW image version of this little stupid thing - NakedApe - 09-13-2023 SMcNeill, thanks for your demo too. Very helpful! RE: HW image version of this little stupid thing - grymmjack - 09-13-2023 (09-12-2023, 11:48 PM)a740g Wrote:(09-12-2023, 10:54 PM)grymmjack Wrote:The `_CLEARCOLOR` is for the sprite transparency. I removed the `_DISPLAYORDER _HARDWARE` line. `_DISPLAYORDER _HARDWARE` will render hardware surfaces only. So, basically `CLS , _RGB32(0, 0, 255)` had no effect with that line.(09-12-2023, 01:21 PM)a740g Wrote: Made a few changes. But without that, it's not using _HARDWARE images? RE: HW image version of this little stupid thing - TerryRitchie - 09-13-2023 (09-12-2023, 09:46 PM)SMcNeill Wrote:Doh, it never occurred to me to use a simple counter to keep track of frames. That's why Steve is the master(09-12-2023, 07:41 PM)TerryRitchie Wrote: The reason you're getting 1000 FPS in hardware mode is because that's the upper limit that can be calculated with TIMER(.001). Only when hardware is taxed enough will the frame rate drop below 1000. The program crashes for me when I try to go a few more than 8000 sprites. Perhaps someone with a better video card and more RAM can tax the hardware layer enough to start seeing the FPS drop below 1000 in hardware mode. (or someone has a better timing method I can use) RE: HW image version of this little stupid thing - TerryRitchie - 09-13-2023 (09-13-2023, 12:28 AM)NakedApe Wrote: Very cool demo, Terry! What a difference using hardware images. I'm on an M1 Mac Mini and I cranked the sprite total up to 20,000. The program ran fine @ 7 FPS software and ~500 FPS hardware, though the hardware speed jumped back'n'forth from 1000 to 500 constantly.Thanks everyone for the feedback. NakedApe, you were able to crank the count up to 20,000? Wowsers. I wonder why I can't get much past 8000? I have 32GB of RAM, a 6th gen i7 and a GTX960 video card with 4GB of VRAM. When I try, for example, 8500, the program crashes before a screen in even seen. I just assumed I was using too much video ram creating all those hardware sprites. Jumping back and forth between 500 and 1000 FPS is because my frame counter is timer based. It's a hack at best. --> 1 / .001 = 1000, 1 / .002 = 500, etc.. RE: HW image version of this little stupid thing - TerryRitchie - 09-13-2023 (09-12-2023, 11:04 PM)grymmjack Wrote:Yes, I agree, a demo showing the virtues of hardware images needs to be in the Wiki, be it this program or someone else's.(09-12-2023, 07:11 PM)TerryRitchie Wrote: It's well worth learning to use hardware images. Here is a little demo I just wrote showing the power of hardware images. This program creates 8000 sprites and then let's the user switch between software and hardware mode to see the performance difference. I'm going to start creating demos for a lesson on hardware vs software images in the tutorial. It's long overdue. |