Creating the illusion of Life sized planets #6
Replies: 1 comment
-
Hi, thanks for your interest and your kind words. As far as I know, both the Z-Buffer and the physics/node system suffer from single precision floats. The Z-Buffer usually has a depth of 24 bits and uses a logarithmic scale, so if you set the near clip value to something low, say 0.01, and the far value to something very high, say 10,000 or more, you'll get a lot of Z-fighting of polygons at high distances. To remediate that, one possibility is to dynamically adjust the Z-buffer (depending on what amount of detail is needed), that's how @ivoyager does it, see here. For the in-engine precision problems that occur far away from the world origin, I'll probably resort to shifting the origin closer to the player. What you brought up is also a very interesting idea, I'll be sure to look into shrinking objects as well. |
Beta Was this translation helpful? Give feedback.
-
Hello!
Thanks a lot for sharing this addon, it's open source addons like this that will help lower the barriers to entry for indie game artists hoping to create their own universe simulator. Anyways, while doing reading on creating universe sim, I noticed that floating point errors that occur in single precision float, ie 32 bit do lead to Z-Fighting when you get out to substantial distances. When objects are several KM away from you in distance, Z-fighting can occur. And the more distant, the more severe this graphical bug becomes.
Some ways people have in countering that is as objects move farther away, they shrink proportionally to give the illusion that is really far away. Have you tried implementing something like this? I do wonder if it's a good way to create the illusion of life sized planets. You land on a planet, the portions near you expand out to realistic size, while the areas of the planet far away would be both smaller and more distant. The scene would look as if those far off mountains are 60 KM away when in reality, they are only for example, 1-3 KM away and much smaller.
I believe there is discussion of double precision support for godot. IF godot 4.0 enables double percision floats, you may not need to do this for planets, moons, and most stars, however, for hypergiant stars, nebulas and galaxies, it maybe necessary. So such a technique would still be potentially useful for 64 bit floats, and for anything smaller than 128 bit floats (quad precision).
Mentions the idea of having things far away shrink proportionally to distance of player.
https://en.wikipedia.org/wiki/Z-fighting
Proposals and serious discussions regarding enabling double precision float in Godot. Would expand the amount of usable area free from such issues from a few kilometers/units to a few billion kilometers/units. So we are going from the radius of a small city to the orbit of Saturn or Uranus.
godotengine/godot-proposals#892
Beta Was this translation helpful? Give feedback.
All reactions