-
-
Notifications
You must be signed in to change notification settings - Fork 22k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support editing scenes of any large physical size #100896
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, it works as expected. I can't see the Andromeda galaxy in the MRP though, even with the Z far distance set to 2**63 - 1
(I can see it if I press F to move to its location). I can see the moon at least. Is this due to the PR being outdated?
Needs a rebase.
Also, the View editor should clamp the FOV value to 1 degree at least:
There could also be a "Infinite"1 checkbox besides the Z far option that makes the option as high as possible (2**63 - 1
). When checked, the Z far slider is disabled.
Footnotes
-
While technically not infinite, it might as well be for all practical purposes and intents. We could also call it "Maximum" if we want to be more accurate, but maybe it's less obvious in terms of what it does. ↩
The Andromeda galaxy is much much farther than that. Try pushing the far distance to
The actual maximum float 32 value is
It's currently clamped at Unless you noticed artifacts I suggest we keep it as is |
Follow-up of #99986.
Note : This PR is ready for review, but kept in Draft state on purpose until dependencies get resolved.
Outline
This PR enables rendering and editing arbitrary large scenes and objects in the Editor.
This is especially useful for open worlds, space scenes and alike.
This is achieved by raising the maximum allowed far (and near) distance in the editor's View settings, and fixing a handful of numerical precision issues :
Dependencies
intersects_ray
andintersects_segment
#100511 (remove numerical precision issues on raycast functions)BVH::ray_query()
#100478 (remove numerical precision issue on gizmo picking)Camera3D::project_local_ray_origin()
#100718 (enables view space raycast)Demo
large_zfar_editor.zip
Vegetation is ~1m tall and ~10m from the origin
The terrain is 10 km large
The earth's radius is 6,000 km
The moon's radius is 1,700 km and is 400,000 km from the origin
The sun's radius is 700,000 km and is 150 million km from the origin
The Andromeda galaxy is 152,000 light-years wide and is 2.5 million light years from the observer
output.webm