Jump to content

Hi-value positions glitch


Recommended Posts

Hey Dad72... I think he knows about the large values and is asking WHY these large values are causing bad renders.  *shrug*  I could be wrong, though.


I have no answers.  http://www.babylonjs-playground.com/#1180R5#5 


I changed cameras, removed the box, added a wireframe sphere2, put a slow spin on both, and I used the renderloop to slowly move the scene toward 400,000 (watch the console).  At about 300,000+, it starts jerking and freaking out.  In fact, I get sphere jiggle before 100,000.


Interesting find, c75!  Strange indeed.  *scratch scratch*

Link to comment
Share on other sites

I can try and shed some light on this "glitch", based on my understanding (I might be completely wrong).


It's isn't a glitch at all, it would happen anywhere because of floating point format IEEE 754, a quick and rough explanation (with error estimation formula) is also at StackOverflow.


In general, increasing the value of floating point number decrees the precision causing glitches like you've found. A quick look through Babylon.js source code, you can see that it uses Float32Array (single precision).


The same issue was addressed also in Ogre3D engine some time ago (slides 130 and a few on, the main emphasis in the presentation is memory cache). The problem was visible already at coordinates around 6000. That's why some engines move the entire world around the camera instead of camera itself (will back with some material as soon as I find it again).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...