2
votes

The objects which I have place at a position (-19026.65,58.29961, 1157) form the origin (0,0,0) are rendering with issues, the problem is refer to spatial Jitter (SJ) ref. Like You can check its detail here or You can see the below image. The objects are rendering with black spots/lines or maybe it is Mesh flickering etc. (Actually I can't describe the problem, maybe the picture will help you to understand it)

enter image description here

I have also try to change the camera near and far clipping but it useless. Why i am getting this? Maybe my object and camera is far away from the origin.

Remember:

I have a large environment and some of my gameobject(where the problem is) at (-19026.65,58.29961, 1157) position. And I guess this is the problem that Object and Camera is very far from the origin (0,0,0). I found numerous discussion which are given below

  1. GIS Terrain and Unity
  2. Unity Coordinates bound Question at unity
  3. Unity Coordinate and Scale - Post
  4. Infinite Runner and Unity Coordinates

I didn't find that what is the minimum or maximum limit to place the Object in unity that it work correctly.

1
There is no baking in the scene.Muhammad Faizan Khan
Is this the problem you're seeing perhaps? en.wikipedia.org/wiki/Z-fightingLasse V. Karlsen
I guess this is not the z-fighting my objects are rendering with black lines or spot which is another issue . i guessMuhammad Faizan Khan

1 Answers

2
votes

Since the world origin is a vector 3(0,0,0), the max limit that you can place an object would be 3.402823 × 10^38 since it is a floating point. However, as you are finding, this does not necessarily mean that placing something here will insure it works properly. Your limitation will be bound by what other performance factors your have in your game. If you need to have items placed at this point in the world space,consider building objects at runtime based on where the camera is. This will allow the performance to work at different points from the origin.

Unity suggests: not recommended to go any further than 100,000 units away from the center, the editor will warn you. If you notice in today's gaming world, many games move the world around the player rather than the player around the world.

To quote Dave Newson's site Read Here:

Floating Point Accuracy

Unity allows you to place objects anywhere within the limitations of the float-based coordinate system. The limitation for the X, Y and Z Position Transform is 7 significant digits, with a decimal place anywhere within those 7 digits; in effect you could place an object at 12345.67 or 12.34567, for just two examples.

With this system, the further away from the origin (0.000000 - absolute zero) you get, the more floating-point precision you lose. For example, accepting that one unit (1u) equals one meter (1m), an object at 1.234567 has a floating point accuracy to 6 decimal places (a micrometer), while an object at 76543.21 can only have two decimal places (a centimeter), and is thus less accurate.

The degradation of accuracy as you get further away from the origin becomes an obvious problem when you want to work at a small scale. If you wanted to move an object positioned at 765432.1 by 0.01 (one centimeter), you wouldn't be able to as that level of accuracy doesn't exist that far away from the origin.

This may not seem like a huge problem, but this issue of losing floating point accuracy at greater distances is the reason you start to see things like camera jitter and inaccurate physics when you stray too far from the origin. Most games try to keep things reasonably close to the origin to avoid these problems.