GL Galore brush speed test (for tilemapped games)

Discuss OpenGL® programming with the GL Galore plugin here
User avatar
lazi
Posts: 632
Joined: Thu Feb 24, 2011 11:08 pm

GL Galore brush speed test (for tilemapped games)

Post by lazi »

The only way on Amiga to display perfect synchronization with the monitor vertical refresh is GLGalore. So using it to display tilemapped game backgrounds for scrolling is inevitable.

I have two problems with it:
- low performance
- uneven performance

You can check the w.i.p. executables for some platforms here: http://kezdobetu.hu/software/downloads/ra/
Of course only OS4/MOS using GLGalore.

So to check the raw performance of GLGalore i made a simple test.
It displays numbers which shows how many times it can fill the display with the brushes in one vertical frame.

Image

The source is lower there.
My Peg2/Radeon9200 result is this:

Code: Select all

Hollywood openGL HW brush test
------------------------------
CPU: ppc
Platform: AmigaOS4
HW kernel: 10.0
Display: 800 x 600 / 24 @ 61
Brushes: 48 x 54
Result: 3 pages/frame.
I would like to ask for help to check the code to see that is it the best mode for the problem, and please drop here the results on different systems.

There is a precompiled Hollywood applet here to test it with the free Hollywood player: http://kezdobetu.hu/software/downloads/ra/test.hwa

Code: Select all

;speedtest
@REQUIRE "glgalore", {link=True}
@DISPLAY 1,{hidden=True, mode="fullscreen", width=800, height=600, DisableBlanker=True}

Function get_verticalfrequency()
	Local f=0
	If Not GetAttribute(#DISPLAY,1,#ATTRDOUBLEBUFFER) Then Return(-1,"Not a doublebuffer display")
	Local timer=StartTimer(#NIL,999)
	While Not timerelapsed(timer)
        f=f+1
		Flip(True)
	Wend
	StopTimer(timer)
	Return(f,"ok")
EndFunction

Function gen_brush(id,col,sw,sh)
	Local tid=CreateTextObject(Nil,id)
	ScaleTextObject(tid,sw,sh)
	Local bid=CreateBrush(Nil,sw,sh,col,{hardware=False})
	SelectBrush(bid)
	DisplayTextObject(tid,0,0)
	EndSelect
	CopyBrush(bid,id,{hardware=True})
	FreeBrush(bid)
	FreeTextObject(tid)
EndFunction

w,h,sw,sh=800,600,48,54
sw=StringRequest("test","Display width/height:"..w.."/"..h.."\nScreen freq:"..freq.."\nEnter tile size",sw,#NUMERICAL,3)
sh=StringRequest("test","Display width/height:"..w.."/"..h.."\nScreen freq:"..freq.."\nEnter tile size",sh,#NUMERICAL,3)
If Val(sw)<1 Or Val(sh)<1 Then End


OpenDisplay(1)

BeginDoubleBuffer(True)
w=GetAttribute(#DISPLAY,1,#ATTRWIDTH)
h=GetAttribute(#DISPLAY,1,#ATTRHEIGHT)
d=GetAttribute(#DISPLAY,1,#ATTRDEPTH)
 
freq=get_verticalfrequency()
TextOut(#CENTER,#CENTER-20,"Display size: " .. w .. " x " .. h .. " / " ..d)
TextOut(#CENTER,#CENTER-10,"Testing with brush size: " .. sw .. " x " .. sh)
TextOut(#CENTER,#CENTER,"Calculated display frequency (Hz): " .. freq)
TextOut(#CENTER,#CENTER+10,"LMB to start. It will exit after 15 seconds.")
Flip()
WaitLeftMouse()



gen_brush(1,$c02020,sw,sh)
gen_brush(2,$20c020,sw,sh)
gen_brush(3,$2020c0,sw,sh)
gen_brush(4,$c0c0c0,sw,sh)
gen_brush(5,$c0c020,sw,sh)
gen_brush(6,$20c0c0,sw,sh)
gen_brush(7,$2020c0,sw,sh)
gen_brush(8,$202020,sw,sh)
gen_brush(9,$008000,sw,sh)
gen_brush(10,$c02020,sw,sh)
gen_brush(11,$20c020,sw,sh)
gen_brush(12,$2020c0,sw,sh)
gen_brush(13,$c0c0c0,sw,sh)
gen_brush(14,$c0c020,sw,sh)
gen_brush(15,$20c0c0,sw,sh)
gen_brush(16,$2020c0,sw,sh)
gen_brush(17,$202020,sw,sh)
gen_brush(18,$008000,sw,sh)

f,frame=0,1000\freq
StartTimer(2,20000)
Repeat
x,y,br=0,0,1
StartTimer(1)
While GetTimer(1)<frame
	DisplayBrush(br,x,y)
	x=x+sw
	If x>w Then x,y=0,y+sh
	If y>h Then br,x,y=Min(br+1,18),0,0
Wend
ResetTimer(1)
Flip
Until timerelapsed(2)=True

StopTimer(1)
StopTimer(2)

Cls
TextOut(#CENTER,#CENTER-10,"Test completed.")
TextOut(#CENTER,#CENTER,"Displayed pages per frame @ freq: " .. br .. " @ " .. freq)
TextOut(#CENTER,#CENTER+10,"Results on the clipboard. LMB to exit.")
Flip()

t=GetVersion()
res$=
"Hollywood openGL HW brush test\n"..
"------------------------------\n"..
"CPU: ".. t.cpu .. "\n"..
"Platform: " .. t.platform .. "\n"..
"HW kernel: " .. t.kernel .. "\n"..
"Display: " .. w .. " x " .. h .. " / " .. d .. " @ " .. freq .. "\n" ..
"Result: " .. br .. " pages/frame."

SetClipboard(#CLIPBOARD_TEXT,res$)


WaitLeftMouse()      
User avatar
emeck
Posts: 187
Joined: Fri Apr 03, 2015 3:17 pm

Re: GL Galore brush speed test (for tilemapped games)

Post by emeck »

@lazi

My results with MacMini 1.5GHz:

Code: Select all

Hollywood openGL HW brush test
------------------------------
CPU: ppc
Platform: MorphOS
HW kernel: 10.0
Display: 800 x 600 / 24 @ 75
Brushes: 48 x 54
Result: 2 pages/frame.
The link is wrong for the applet. It should be http://kezdobetu.hu/software/downloads/ra/speedtest.hwa
PowerBook 5.8 MorphOS 3.18
Mac Mini MorphOS 3.18
User avatar
lazi
Posts: 632
Joined: Thu Feb 24, 2011 11:08 pm

Re: GL Galore brush speed test (for tilemapped games)

Post by lazi »

@emeck

Thanks for testing. Same performance as Peg2.
How the game works?

The link is corrected.
plouf
Posts: 584
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: GL Galore brush speed test (for tilemapped games)

Post by plouf »

same here
ibook G4 G4 1,33
2 pages / 61hz
Christos
User avatar
Juan Carlos
Posts: 920
Joined: Mon Sep 06, 2010 1:02 pm

Re: GL Galore brush speed test (for tilemapped games)

Post by Juan Carlos »

The problem is that GL Galore use OpenGL 1.0, when AmigaOS4 and MorphOS currently has available OpenGL 2, although current version of Open GL is the 4.
The other problem is to find examples for this Open GL 1, although I found someones the monday but the quality effects are from 90s.
User avatar
airsoftsoftwair
Posts: 5626
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: GL Galore brush speed test (for tilemapped games)

Post by airsoftsoftwair »

Hmm, I get just 1 page on a modern Windows PC?!
User avatar
lazi
Posts: 632
Joined: Thu Feb 24, 2011 11:08 pm

Re: GL Galore brush speed test (for tilemapped games)

Post by lazi »

airsoftsoftwair wrote: Thu Oct 03, 2024 10:00 pm Hmm, I get just 1 page on a modern Windows PC?!
Yes that is another problem. Without GLGalore my "modern pc" displays 11 pages per frame and just 1 with the plugin.
There is a minor difference on Amiga too, but not as significant as running on windows.

Unfortunately I can't check it with other languages, what is the performace that can be expected by the specific hardware.
User avatar
emeck
Posts: 187
Joined: Fri Apr 03, 2015 3:17 pm

Re: GL Galore brush speed test (for tilemapped games)

Post by emeck »

@lazi

Game speed is OK on the MacMini 1.5GHz.
PowerBook 5.8 MorphOS 3.18
Mac Mini MorphOS 3.18
User avatar
emeck
Posts: 187
Joined: Fri Apr 03, 2015 3:17 pm

Re: GL Galore brush speed test (for tilemapped games)

Post by emeck »

@lazy

Actually, the scrolling text in the start screens isn't as smooth as it seems at first. It kinda jumps backwards a little to the right every second I would say.
PowerBook 5.8 MorphOS 3.18
Mac Mini MorphOS 3.18
User avatar
airsoftsoftwair
Posts: 5626
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: GL Galore brush speed test (for tilemapped games)

Post by airsoftsoftwair »

Btw, have you tried it with RebelSDL? RebelSDL also supports hardware double buffers that should provide perfect vsync. I've tried your example on a Windows PC with RebelSDL and I get 17 pages now. With GL Galore I only got 1 page on the same system.
Post Reply