Closed coolcomfort closed 1 year ago
I can not reproduce the issue in any of the linked examples. I have test this with Chrome 109.0.5414.87 on macOS. So maybe this is a device related issue.
Do you mind testing whether you see jumps in the following example? https://mdn.github.io/dom-examples/pointer-lock/
Issue does not seem to replicate on the pointer lock example. I would also like to point out that I have tested this in other 3D engines, such as Babylon, Play Canvas and WebGL Unity and have not had the same issue. For these reasons, along with others not being able to reproduce this on their own devices, leads me to believe it may come down to the Three JS engine along with hardware.
Since this post I have tested this issue in FireFox, and instead of skipping, FireFox seems to lag on mousemove whenever the skipping would normally take place. The lag is occurring at about the same rate and just as affecting if not worse. I will take a video on that as well if needed.
Specs: Processor: Intel Core i7-1160G7 Processor Graphics Card: Intel Iris Xe Graphics
Can you try to update the Intel driver to the latest version? I know it sounds silly but could you also test with a different mouse?
I did have a pending driver update for my graphics card, but after installing, this did not fix the issue. When I first started studying three js I assumed the issue was the mouse, so I went ahead and purchased a new one. However, after exploring other 3D game engines for JS and not seeing the same issue, I am more inclined to believe this has to do with possibly the internals of three js. More than willing to share more details.
I've worked and tested PointerLockControls
on different devices using different operating systems. I also use a similar implementation for first-person games where I have never encountered this particular issue (nor it was reported by users).
If we (the maintainers) are not able to reproduce the issue on our devices, I'm afraid we can't investigate the root cause. In such cases, usually the OP has to find the exact line(s) of code causing the issue.
I believe this only happens if the mouse has a polling rate > 250Hz. I implemented this solution a few months ago and have had no issues since.
https://stackoverflow.com/a/69672260/4577551
Basically you need to exclude any movementX or movementY values whose absolute value is greater than window.innerWidth/3 or window.innerHeight/3, respectively
Thanks for the feedback! Unfortunately, this does not explain why the OP experienced the issue only with three.js apps and not with other JS engines.
In any event, this issue is going to be closed since there are too less information for further investigation.
It’s a 3+ year old OS bug. Not three specific
On Wed, Mar 29, 2023 at 1:06 AM Michael Herzog @.***> wrote:
Thanks for the feedback! Unfortunately, this does not explain why the OP experienced the issue only with three.js apps and not with other JS engines.
In any event, this issue is going to be closed since there are too less information for further investigation.
— Reply to this email directly, view it on GitHub https://github.com/mrdoob/three.js/issues/25280#issuecomment-1488126643, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ3FPG56PXDQ6XXRD2ZUJITW6PUQ7ANCNFSM6AAAAAATZ6A7YY . You are receiving this because you commented.Message ID: <mrdoob/three. @.***>
This is definitely pertaining to Xiris graphics card and likely nothing else. I've tested this issue on multiple devices and haven't had the same issue.
FYI: There is a workaround now that fixes the stutter: https://github.com/mrdoob/three.js/issues/27747#issuecomment-1944413572
Description
I have noticed a common three js problem that appears to span all FPS camera examples in Chrome. The camera appears to flicker or rotate randomly (on x axis), when I move my mouse continuously to the left or right. Here is a video demonstration:
https://streamable.com/4135wl
Notice the three abrupt skips that take place in the first half of the video. I have done a bit of research and the two most common solutions presented appear to be changing the camera order to "YXZ" and as well as implementing "yaw" and "pitch" values for mouse move in order to prevent gimbal lock. I have tried these solutions along with several others and have had no luck in fixing the issue. One last thing to point out is the issue does seem to become more apparent with a higher tessellated environment, but I have had it happen in low tessellated environments as well.
Below, I have created a simplified FPS example based off the one on the Three JS website. This uses no imported meshes, no lighting, no fog, just a scene, camera, three js geometry along with three js provided collision detection. I have placed random boxes around the world to help notice the skip. I have also increased the widthSegments and heightSegments of each box to 250 in order to help with a replicating the bug easier. Feel free to increase or lower these in order to find a correlation.
Reproduction steps
Code
Live example
Screenshots
https://streamable.com/4135wl
Version
r148
Device
Desktop
Browser
Chrome
OS
Windows