Forum Discussion
Capyvara
12 years agoExplorer
Floating point precision issues
Just as an warning, my game started to have some visible issues after the position values get larger than 5000, the headtracking lost a bit of smoothness and closer to camera objects seems to shake a bit, on a regular camera/monitor setup these kind of artifacts only gets visible on much larger values, however I think due to nature of the VR setup, seems that precision became a issue much sooner than I expected.
Anyone have any ideas on how to handle mitigate this?
Anyone have any ideas on how to handle mitigate this?
24 Replies
Replies have been turned off for this discussion
- cyberealityGrand ChampionI just tested this with a simple scene (just some cubes) and it looks OK. 5,000 is also not that big of a number in terms of floating point accuracy. So I'm not really sure where the problem is.
Would it be possible to provide us with a simple example that displays the problem you are describing? It will help us pinpoint the problem if we can reproduce it. Thanks. - CapyvaraExplorerI'll try to isolate the problem and send you a repro project.
- basteckiHonored GuestI've got the same problem.
When camera position is far away from (0,0,0) (i.e. 0,0, 50000) the objects close to camera shake (objects shakes more when camera is more far away). Is there any way to fix this issue?
I am using Unity Pro 4.2.2f1 and Oculus SDK version ovr_unity_0.2.5c_lib.
Link to example project with this issue (it's only an ovr_cameracontroller prefab and a cube very clos to camera - after pushing space bar the camera and the cube moves 10k units) - http://speedy.sh/vp3Ay/NewOculusTest.zip
Link to youtube video - raidho36ExplorerYou don't fix this. GPU operate on single-precision floats, and this jitter is a result of vertex multiplication precision error.
You have to design the game so that the player is close to world center at all times. If your game design doesn't allow it, use programmatical tricks, such as re-locating the whole world closer to center. - hoestereyProtege
"raidho36" wrote:
You don't fix this. GPU operate on single-precision floats, and this jitter is a result of vertex multiplication precision error.
You have to design the game so that the player is close to world center at all times. If your game design doesn't allow it, use programmatical tricks, such as re-locating the whole world closer to center.
Sorry to necro this but is there something related to VR that amplifies the floating point precision errors? I'm seeing horrible jitter at relatively low (5,000-10,000) values from origin. Normally I'd expect these issues to arise at much higher values.
Thanks - vrdavebOculus Staff10,000 units is pretty far. You should probably keep it under 1000. The error would be most obvious when the camera is moving, which is always the case while VR is active.
- hoestereyProtegeOk thanks for the info.
- hoestereyProtege
"vrdaveb" wrote:
10,000 units is pretty far. You should probably keep it under 1000. The error would be most obvious when the camera is moving, which is always the case while VR is active.
Actually could I ask why 1000 meters. At 9999.99 meters I should still have millimeter accuracy correct? (10 to the -3 = millimeters.) My game the player is 2 meters tall and moves pretty quickly, I'm surprised to see jitter at this scale. At 999 meters I believe I'd have 100 micrometer accuracy.
Does something VR specific require higher then millimeter accuracy to avoid jitter? I have two OVR controllers, perhaps the 2nd set following the first is causing this? - vrdavebOculus Staff
"hoesterey" wrote:
Yes, but millimeter-scale error will be noticeable in VR. I just tested this and Unity the head pose does become jittery at 10k units (and about 10x so at 100k units). I would have to see a video or build of your project to be sure it's the same issue. At 1k units, there is no noticeable jitter in head tracking. So if you're placing things more than 2k units from the origin, I would recommend moving the origin like this: http://wiki.unity3d.com/index.php/Floating_Origin
At 9999.99 meters I should still have millimeter accuracy correct?"hoesterey" wrote:
The only major difference is in your sensitivity to the VR head pose. Your brain tends to notice error there sooner than it would notice the same error in the position of another character or object in the game. Unity's VR camera simply applies Oculus head tracking in a local reference frame that is concatenated after the initial local pose of the Camera at start. How are the OVRCameraRigs set up? Do you have them layered such that one renders on top of the other? Until 5.3.3p1, there was a known issue where the two cameras could render with slightly different poses in that use case.
Does something VR specific require higher then millimeter accuracy to avoid jitter? I have two OVR controllers, perhaps the 2nd set following the first is causing this? - hoestereyProtege
"vrdaveb" wrote:
"hoesterey" wrote:
Yes, but millimeter-scale error will be noticeable in VR. I just tested this and Unity the head pose does become jittery at 10k units (and about 10x so at 100k units). I would have to see a video or build of your project to be sure it's the same issue. At 1k units, there is no noticeable jitter in head tracking. So if you're placing things more than 2k units from the origin, I would recommend moving the origin like this: http://wiki.unity3d.com/index.php/Floating_Origin
At 9999.99 meters I should still have millimeter accuracy correct?"hoesterey" wrote:
The only major difference is in your sensitivity to the VR head pose. Your brain tends to notice error there sooner than it would notice the same error in the position of another character or object in the game. Unity's VR camera simply applies Oculus head tracking in a local reference frame that is concatenated after the initial local pose of the Camera at start. How are the OVRCameraRigs set up? Do you have them layered such that one renders on top of the other? Until 5.3.3p1, there was a known issue where the two cameras could render with slightly different poses in that use case.
Does something VR specific require higher then millimeter accuracy to avoid jitter? I have two OVR controllers, perhaps the 2nd set following the first is causing this?
Thanks again,
That makes sense. I'm making an Airship game, the ship itself is 50 meters so you can imagine how quickly things get away from origin when your moving at 100 meters per second. I considered scaling everything down but as the problem is relative that wouldn't really help. ;)
I am using two OVR controllers with one rendering on top. 5.3.1p2 so sounds like that could be part of the issue. I have an older development video on youtube here: https://www.youtube.com/watch?v=_d3JUVJYGDc
You'll see in the video that the GUI is what is noticeably jittering. It is rendered with a 2rd set of OVR cameras. A 3rd set renders the reticule and such over everything.
Thanks for posting that script as well. I was looking at that but am terrified of the performance implications. I am imagining quite a hitch when moving 1000+ game objects. I do have some good transition points where I could warp the player as a backup as well. Interesting problem to solve, didn't expect floating point imprecision to be magnified in VR.
Thanks again!
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 7 years agoAnonymous
- 11 months ago
- 1 year ago
- 5 years ago
- 1 year ago