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 / [SOLVED] Free Mouse Look 3D not smooth

Author
Message
PSY
Developer
7
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 20th May 2023 19:35
Hi guys,

I have been experimenting with a free mouse look function.
There is the problem when the mouse reaches the edge of the screen, so I tried to center the mouse position at each frame.
Unfortunately, this only works when I move the mouse VERY slowly. As soon as I move the mouse faster, it gets jerky, no matter how high the sync rate is.
Am I missing something?
I understand that there is a GetRawMouseWheelDelta(), so why is there no GetRawMouseDeltaX() and GetRawMouseYDeltaY() which would return the vertical and horizontal mouse movement?



Cheers,
PSY






PSY LABS Games
Coders don't die, they just gosub without return

The author of this post has marked a post as an answer.

Go to answer

Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 20th May 2023 22:39 Edited at: 20th May 2023 22:50
i get no jerk with your code which is essentially the same as mine.

that is, until i use windowed mode and then i can find said jerk with your code when i try hard to exceed the dimensions of the window in 1 loop.

my first thought was to detect if mouse x/y had went off the window which theoertically couldnt happen but does.

adding this up top:

...and this to Freelook()

i'm seeing the red background only rarely. i wonder how often for you?

since yours sounds more noticable to you (in windowed mode it still wasn't often for me), i wonder what your Pointer Speed might be? or how our Windows' Scale or similar "custom" settings might be coming into play.

regardless, as i was testing, i realized it really shouldnt matter so there may be a flaw in our methods to achieve DeltaX/Y (short of preferred native commands) and/or application to camera angles?

perhaps Wrapping() DeltaX/Y and/or CamAngles?

and you use Raw values while i use Pointer which i expect AppGameKit would appreciate more? can you see stutter with my code?

anyway, you might try some of this to try and dial in the issue.
PSY
Developer
7
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 21st May 2023 00:29
Hello Virtual Nomad,

thank you very much for your answer!

I just found the problem. It was a bug with GSync ^^.
As soon as I disabled GSync, the code ran fine, mouse movement was perfectly smooth.
So I re-enabled GSync (both in fullscreen and windowed mode), and the movement was still perfect.
It must have been a problem with the Windows/GSync driver combination. Very strange, but I remember having this problem some time ago.

Anyway, thanks for your efforts. I might never have tried to disable GSync if you hadn't replied to me

Cheers!


PSY LABS Games
Coders don't die, they just gosub without return
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 21st May 2023 00:47
i had to google GSync (thought it was a command parameter that i never heard of). my low-spec laptop doesn't have that (issue)!

you're welcome for the memory jog and glad it's resolved. forward!
PSY
Developer
7
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 21st May 2023 23:23
This post has been marked by the post author as the answer.
Update:

I did some further testing.
Seems the jerky movement only happens when G-Sync is enabled AND AGKS uses VULKAN for rendering.
When G-Sync is disabled, rendering works fine with both Vulkan and OpenGL.
When G-Sync is enabled, only OpenGL works fine, Vulkan lags.


PSY LABS Games
Coders don't die, they just gosub without return

Login to post a reply

Server time is: 2024-04-19 04:32:00
Your offset time is: 2024-04-19 04:32:00