Best way to do lots of moving things on screen?

Discuss any general programming issues here
SamuraiCrow
Posts: 242
Joined: Fri May 15, 2015 5:15 pm
Location: Ft. Collins, Colorado USA

Re: Best way to do lots of moving things on screen?

Post by SamuraiCrow » Mon Jun 24, 2019 12:48 pm

xabierpayet wrote:
Mon Jun 24, 2019 12:10 pm
Hello Bugala, and Andreas, i test the snippet supplied by Bugala, and my results are better without RebelSDL, using RebelSDL i have 132000 ms time when i execute the script ,whithout RebelSDL my result is 12900 ms, this in windows 10 64 bits, any idea about why this is happening?
Did you read the immediate reply to Bugala's post?

xabierpayet
Posts: 185
Joined: Fri Feb 24, 2012 9:34 am

Re: Best way to do lots of moving things on screen?

Post by xabierpayet » Mon Jun 24, 2019 12:50 pm

yes, and the results here are the same

User avatar
airsoftsoftwair
Posts: 3206
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Best way to do lots of moving things on screen?

Post by airsoftsoftwair » Mon Jun 24, 2019 4:53 pm

@XabierPayet:
Please post your script.

xabierpayet
Posts: 185
Joined: Fri Feb 24, 2012 9:34 am

Re: Best way to do lots of moving things on screen?

Post by xabierpayet » Mon Jun 24, 2019 6:02 pm

is the same posted by bugala, with no changes

User avatar
airsoftsoftwair
Posts: 3206
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Best way to do lots of moving things on screen?

Post by airsoftsoftwair » Mon Jun 24, 2019 6:08 pm

xabierpayet wrote:
Mon Jun 24, 2019 6:02 pm
is the same posted by bugala, with no changes
That's what I expected. So you didn't read the post that SamuraiCrow pointed you to... here it is again: viewtopic.php?f=10&t=2168&start=10#p11526

xabierpayet
Posts: 185
Joined: Fri Feb 24, 2012 9:34 am

Re: Best way to do lots of moving things on screen?

Post by xabierpayet » Mon Jun 24, 2019 6:40 pm

no, i try this option before, with the same results

EscapeQuit(True)
@DISPLAY {Width = 1920, Height = 1080}

;@REQUIRE "rebelsdl",{EnableVSync=False}

CreateBrush(1, 5, 5, #WHITE, {hardware=True})

BeginDoubleBuffer(True) ; set up a hardware double buffer

StartTimer(1)
SetFillStyle(#FILLCOLOR)
For move=1 To 30
For a = 1 To 100
For b = 1 To 100
DisplayBrush(1, 10 + (a*8) + move, 10+(8*b))
Next
Next
Flip
Cls
Next
DebugPrint(GetTimer(1))


3137 ms with this snippet

8689 ms with the rebelSDL plugin activated

User avatar
airsoftsoftwair
Posts: 3206
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Best way to do lots of moving things on screen?

Post by airsoftsoftwair » Mon Jun 24, 2019 7:14 pm

xabierpayet wrote:
Mon Jun 24, 2019 6:40 pm
3137 ms with this snippet
8689 ms with the rebelSDL plugin activated
Huh? Are you on an A500? :) I get 409ms with RebelSDL and 478 without RebelSDL. It's not a big difference because this example draws lots of very small tiles which probably doesn't make that much of a difference between GPU and CPU blitting. It's different with bigger tiles, though.

xabierpayet
Posts: 185
Joined: Fri Feb 24, 2012 9:34 am

Re: Best way to do lots of moving things on screen?

Post by xabierpayet » Mon Jun 24, 2019 7:22 pm

lol, i´m on an old pc, and rebelsdl is very slow here

User avatar
airsoftsoftwair
Posts: 3206
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Best way to do lots of moving things on screen?

Post by airsoftsoftwair » Wed Jun 26, 2019 7:46 pm

By the way, it can happen that Hollywood's inbuilt double buffer is faster than hardware double buffering using RebelSDL. It really depends on lots of different factors. Hollywood's inbuilt double buffer also uses some optimization techniques like only refreshing what has really changed. RebelSDL's and GL Galore's double buffer can't do that, it will always redraw the whole shebang.

GPU acceleration will become really significant when scaling and rotating brushes. This is definitely much faster using RebelSDL or GL Galore.

Another key advantage of RebelSDL and GL Galore is that their hardware double buffers are perfectly synchronized with the vertical refresh so there will be no artefacts when scrolling, etc. This is not possible with Hollywood's inbuilt, software-based renderer. This will lead to some artefacts because it's not synchronized with the vertical refresh.

recedent
Posts: 7
Joined: Tue Jan 16, 2018 10:40 am

Re: Best way to do lots of moving things on screen?

Post by recedent » Tue Aug 06, 2019 9:40 am

I'm testing the game written by Bugala on a few different MorphOS computers and I noticed a very strange thing: It runs much faster on a Mac Mini 1,5 GHz than on a PowerMac G5 2,7 GHz (up to five times faster on G4 than on G5). How come? Is it possible that the G5 CPUs need some special binary (like 060 vs 040)?

Post Reply