Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / Vsync() in Basic mode

Author
Message
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 3rd Jul 2021 19:53 Edited at: 5th Jul 2021 12:21
If I use setvsync in "basic" mode I only get about 45 fps whereas if I do the same using "Prefer Best" I get a solid 60 fps or at least very close . If I use setsync I get about 130 fps in "Basic" and about 180 fps in "Prefer Best". Is setVsync broken in Basic mode ? Is there a solution? This has gotta be a bug , not too serious as can use setsyncrate() . Has anybody else found this to be the case and if so is there a remedy. Thanks for reading and have a nice evening.

I have raised this issue on Github and hope it can be resolved.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 5th Jul 2021 17:24
Quote: "I have raised this issue on Github"

it's best to include OS and any other pertinent info when posting bugs.
any chance you're on a mac? ie, does THIS pertain to you?
[My Itch.io Home] [Community Apps on Itch.io]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=agk] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[AGK Showcase][Google Forum Search]
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 5th Jul 2021 17:52
It's an HP 15s fq1020na. Windows 10 latest. 128 gig ssd and 16 gigs ram . I3 processor gen 10
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 5th Jul 2021 21:04
and current version of studio, i expect?
[My Itch.io Home] [Community Apps on Itch.io]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=agk] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[AGK Showcase][Google Forum Search]
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 6th Jul 2021 02:24 Edited at: 7th Jul 2021 09:24
I will try an older version of studio and see if that fixes it.
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 7th Jul 2021 13:36 Edited at: 7th Jul 2021 13:36
Can I download a previous version of studio?. If so where from.
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 8th Jul 2021 12:55
Could someone please tell me if this problem is right across the board or is only a small number. Thank you.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 8th Jul 2021 20:14 Edited at: 8th Jul 2021 20:16
Quote: "If I use setvsync in "basic" mode I only get about 45 fps whereas if I do the same using "Prefer Best" I get a solid 60 fps or at least very close"

I'm Not 100% sure on his issue but i think setVsync() was implemented specifically for Vulkan.
Although it works on "basic" it is not intended specifically for classic. (Along with the policy that classic will only recieve maintenance updates)

Quote: "If I use setsync I get about 130 fps in "Basic" and about 180 fps in "Prefer Best"."

Regarding the other stuff; They are different renderers so i would imagine they deliver different frame rates, and seeing as they are 3rd party products i dont see how TGC could do anyhing about it anyway.
Qube_
9
Years of Service
User Offline
Joined: 21st Oct 2014
Location: Omnipresent
Posted: 10th Jul 2021 20:00
Quote: "I'm Not 100% sure on his issue but i think setVsync() was implemented specifically for Vulkan.
Although it works on "basic" it is not intended specifically for classic. (Along with the policy that classic will only recieve maintenance updates)"

SetVSync() has been part of AppGameKit since the beginning.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 10th Jul 2021 21:12
There you go. Wrong again!
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 10th Jul 2021 21:15
I just tried it in classic with exactly the same frame rate reached . I'm with Qube on this if it's available in classic it should work .
Qube_
9
Years of Service
User Offline
Joined: 21st Oct 2014
Location: Omnipresent
Posted: 11th Jul 2021 01:15 Edited at: 11th Jul 2021 01:16
@Pfaber Try this https://github.com/TheGameCreators/AGK-Studio/issues/159#issuecomment-867805639 and see what you get. Do you use Windows? as all my issues with refresh rate are Mac based.
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 12th Jul 2021 01:06
Yes I use Windows. When I use vulkan it works great very smooth but not so good with setsyncrate() and it's the other way round with opengl which causes me a problem as in one works well one way and the other the other way. The way out is to only use #renderer"Basic" which is a shame as Vulkan is really good with setvsync() or to only use vulkan. I guess I could make two 1 for vulkan and 1 for opengl and offer both copies in the download and I think that is the solution.
Qube_
9
Years of Service
User Offline
Joined: 21st Oct 2014
Location: Omnipresent
Posted: 12th Jul 2021 02:56
Did you try the code from the link I posted above your post?
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 12th Jul 2021 07:07
not yet it was too late last night but I did read all the stuff and did try using setsyncrate and setvsync together and I could not get it to work as described. it was using which ever command came last. I'll try and run it now.
hosch
Developer
2
Years of Service
User Offline
Joined: 25th May 2021
Location:
Posted: 12th Jul 2021 10:21
Unfortunately I can not confirm the issue for Win 10, latest Studio version. Vsync and Syncrate both work as intended across all my machines and even in the HTML5 export (where I use only Vsync as recommended).
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 12th Jul 2021 11:05
Hi Qube yes I have now run the code and I was getting 60 fps in basic and advanced. I will have a play and see what happens. I'm obviously missing the point . Nice code by the way. Thanks for your time.
Qube_
9
Years of Service
User Offline
Joined: 21st Oct 2014
Location: Omnipresent
Posted: 12th Jul 2021 16:17
And what happens when you press V to turn off VSync and then T to turn off DeltaTime - That should show you the max FPS the app can run on your PC.
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 13th Jul 2021 06:43
Yes it does and it shows about 670 fps . I really do not see how you managed to get 60 fps using vsync() in basic mode and I can only acheive 48 or there abouts. I think what I'm doing works fine but for some reason in Basic openGL it appears to be reading the device fps wrongly.
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 13th Jul 2021 06:59 Edited at: 14th Jul 2021 14:31
It could be my computers just not fast enough to do the 60fps in basic mode but I doubt it.
I'll probably just use renderer"Basic" for now or maybe just Vulkan which would be the best . Not sure what percentage of pcs support Vulkan right now but it's way quicker on my laptop if I use setvsync(1) for it . I'm gonna find out and make a choice .
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 15th Jul 2021 17:48
Good news in that I now understand what is going on . If I use setwindowsize (1920,1080,0) and setvsync(1) in "Basic" mode everything is great , however if I use setwindowsize(1920,1080,1) for full screen in "Basic" mode with setvsync(1) then it will only give me 48 fps or there abouts . For some reason it doesn't work in full screen . I don't know why but I do know under what circumstances it does not behave correctly . so there we are it does work but only in windowed mode of any resolution but does not in full screen mode. This is only in "Basic" mode in "Advanced" it is fine . What I don't know is if anybody else has the same problem, if you do then please make me aware so I know and can post this on github TGC and explain the problem in more detail. I was thinking my computer was not upto it but am now sure it is a bug .
@ Qube . The reason I realized this is your code was not in full screen and mine was and that was the only difference I could see. Took a while to sink in though.
hosch
Developer
2
Years of Service
User Offline
Joined: 25th May 2021
Location:
Posted: 16th Jul 2021 08:39
I ran Qube's code too and, (un)fortunately, still can not confirm there is an issue. At this point it would be helpful, if you would post your example that gives you headaches, Pfaber1.
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 16th Jul 2021 12:15 Edited at: 17th Jul 2021 04:02
ok I'll try and put some code up here. If I run this in setwindowsize(1920,1080,1) it will work at about 48 fps and if I run it at setwindowsize(1920,1080,0) it works fine but I want full screen. Oh yes v turns vsync() on and b turns vsync() off.

hendron
8
Years of Service
User Offline
Joined: 20th Dec 2015
Location:
Posted: 16th Jul 2021 15:26 Edited at: 16th Jul 2021 15:31
Quote: "If I run this in setwindowsize(1920,1080,1) it will work at about 48 fps and if I run it at setwindowsize(1920,1080,0) it works fine but I want full screen."


Does your monitor's native/desktop resolution happen to be higher than 1920x1080? When you run any AppGameKit app in full screen, it will render at your desktop resolution, no matter what you set the window size or virtual resolution to. Depending on your specs and native resolution, this could cause slower frame rates in full screen. You can test this by checking GetDeviceWidth() and GetDeviceHeight(), which return the width and height of the backbuffer.

Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 16th Jul 2021 16:12
Yes the native resolution is 1920x1080 but I will try that when I get in . Thanks for the input.

Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 16th Jul 2021 16:16
It maybe that my system is not powerful enough but I doubt it. Only had it six months from new.
hosch
Developer
2
Years of Service
User Offline
Joined: 25th May 2021
Location:
Posted: 22nd Jul 2021 10:00
Hello,

in line 21 you are running Sync() and in line 47 you are running Sync() again, although in a loop. I doubt it has any effect, but you don't need the Sync() in line 21. Can you provide the media files with the example, so I can run it on my hardware?
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 23rd Jul 2021 09:57 Edited at: 23rd Jul 2021 09:59
Hi Hosch there is only one object in this example and a .png texture and here it is .

Attachments

Login to view attachments
hosch
Developer
2
Years of Service
User Offline
Joined: 25th May 2021
Location:
Posted: 26th Jul 2021 17:16
Hello,

I ran your code in AppGameKit Studio and AppGameKit Classic. I get a solid 60 FPS with SetSyncRate and 75 FPS with VSync (using a 75 Hz monitor) on both my machines. I can not confirm your issue unfortunately.
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 27th Jul 2021 13:17
Oh right I'm on a laptop might be some power saving thing. Works fine on Vulkan . It does not matter too much as runs pretty well with setsyncrate() . I would use it if I could though. Could just be a laptop thing . Thanks for testing.

Login to post a reply

Server time is: 2024-04-23 23:21:04
Your offset time is: 2024-04-23 23:21:04