![]() |
Smooothness - 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: Smooothness (/showthread.php?tid=3113) |
Smooothness - NakedApe - 10-10-2024 I was just messing around with a particle fountain. Sometimes the program runs smoothly, but if I change the _limit a little it can become hurky-jerky. Like the below seems to do great at 60 or 80 FPS, though runs less smoothly at 50 or 70. Is it my laptop? Is smoothness in graphics always a dance between run-speed and the number of pixels that items move per cycle? I'm curious how this could be made to run smoothly at various _limits. Any thoughts or insights appreciated! Code: (Select All)
RE: Smooothness - bplus - 10-10-2024 That looks smooth, I see or imagine a slight spiral effect when I change pset to circle which magnifies the view. Hey have you seen my Particle Fountain? Code: (Select All) _Title "Particle Fountain" 'b+ 2020-08-27 RE: Smooothness - NakedApe - 10-11-2024 Actually I have seen that. Very sweet. Makes me wanna drink champagne. RE: Smooothness - SMcNeill - 10-11-2024 I took a moment to just restructure this a bit, to get rid of that EVIL goto.... (Not that I personally have anything against GOTOs. ![]() Code: (Select All)
This runs and moves pretty dang smooth on my PC for me. I was thinking of swapping it over to use _MEM instead of PSET (and maybe swapping it over to just use hardware images instead of software) to see how it'd affect performance, but it doesn't seem necessary. Maybe my PC is just quick enough to run into any bottleneck/issue that you're seeing? RE: Smooothness - NakedApe - 10-11-2024 Thanks, Steve. I like your version. As for the program jerkiness, I think I'd either had too much coffee or not enough. ![]() RE: Smooothness - DSMan195276 - 10-11-2024 `_Limit 60` will give you the smoothest, though you can't get it perfect. The gist of the problem is that the QB64 window is rendered at 60 FPS, and every time you call `_Display` you're queuing another frame to be displayed in the window. If you queue too many frames then some of them have to be dropped and the pixels will skip a spot. If you queue them too slowly then at some point QB64 will have to display the same frame twice and they'll appear to get stuck. RE: Smooothness - bplus - 10-13-2024 I took a moment to overhaul everything and reinsert a GoTo ![]() Code: (Select All) Option _Explicit RE: Smooothness - NakedApe - 10-13-2024 (10-11-2024, 05:29 AM)DSMan195276 Wrote: `_Limit 60` will give you the smoothest, though you can't get it perfect. The gist of the problem is that the QB64 window is rendered at 60 FPS, and every time you call `_Display` you're queuing another frame to be displayed in the window. If you queue too many frames then some of them have to be dropped and the pixels will skip a spot. If you queue them too slowly then at some point QB64 will have to display the same frame twice and they'll appear to get stuck.Thanks, @DSMan195276. That makes sense. So one should use trial and error to find the FPS sweet spot for a given graphic function? Or just go with _limit 60 and call it a day, given that it'll never be perfect? Thnx. Fancy mod, Bplus! ![]() RE: Smooothness - SMcNeill - 10-13-2024 (10-13-2024, 03:57 PM)NakedApe Wrote:(10-11-2024, 05:29 AM)DSMan195276 Wrote: `_Limit 60` will give you the smoothest, though you can't get it perfect. The gist of the problem is that the QB64 window is rendered at 60 FPS, and every time you call `_Display` you're queuing another frame to be displayed in the window. If you queue too many frames then some of them have to be dropped and the pixels will skip a spot. If you queue them too slowly then at some point QB64 will have to display the same frame twice and they'll appear to get stuck.Thanks, @DSMan195276. That makes sense. So one should use trial and error to find the FPS sweet spot for a given graphic function? Or just go with _limit 60 and call it a day, given that it'll never be perfect? Thnx. I'd think perfect factors of 60 would work just as well. For example, with a _LIMIT 30, each frame should stay up for 2 complete tics of the display, without having them suffer from that stray being left over. Same with _LIMIT 120. Each frame would be up for 1/2 tic of a display, so you'd basically always have the 2nd frame overwrite the 1st, but it'd be a consistent change, making it seem like the ball is just dropping 2 pixels per frame instead of 1. It'd still be smooth, without that odd frame out which would either lag up or jerk ahead to catch up. RE: Smooothness - NakedApe - 10-13-2024 OK, that also makes sense. Got it. Thanks, Steve. |