-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Increase the default Camera Zfar to 4000 #33207
Increase the default Camera Zfar to 4000 #33207
Conversation
It was this issue #32764. I'm no precision guru but generally as I understand it if you are pushing the Z far out, you'd usually be wanting to be pushing the Z near out as well (rather than further in). Myself I'm not sure the defaults for the camera are all that bad, but it depends on the game and the scale used in the game. Another possible option is that in the editor you could dynamically change the Z near and far if you were worried about objects going out of view, not sure if this is practical or really needed that much. In that issue it was a bit of a special case that is unlikely to happen in reality, aside from having very large planes with no tessellation. Also some hardware might end up with less Z buffer precision than others (I think there is a setting in Project Settings->Rendering->Quality->Depth->Hdr) so something that looks ok on desktop with a massive range might not look so good on mobile with more z fighting. |
As-is I don't think this is a good change. At best, if any issues with Z-fighting are hard to notice, this would still mislead users into thinking that Godot currently supports such large scales. Until we have double-precision floats (proposal 892), the usable area is limited to a few kilometers in most use cases. Eventually, it would be nice to have multiple cameras per viewport, which would allow for vastly larger clipping distances without Z-fighting. The linked PR is closed due to this being an issue that should be tackled in 4.0 with Vulkan, but aside from that, I would suggest waiting to implement multiple cameras until after proposal 892 is implemented so that it would have a practical use case. For right now, honestly, the current value of 500 could be larger without too many downsides. I suggest no more than 4000 to avoid being misleading, so perhaps 4000 or 2000 are good values. |
b406e50
to
f4767fc
Compare
This comment has been minimized.
This comment has been minimized.
Now that #13129 is resolved in the |
f4767fc
to
a0600d0
Compare
I personally think that 1000 is enough for majority of users... |
@Chaosus Maybe, but going above doesn't seem to cause much of an issue from my testing (in |
a0600d0
to
2649f40
Compare
2649f40
to
42dafc2
Compare
I'm always having to increase this limit when working in the engine, I'm for changing this by default as it always seems very low when working on the importers at least its much more practical to have it at that level to me. I import probably the most varied set of models so this is useful for me. You can try the lumberyard bistro and without the limit change its bad. |
Needs a rebase, otherwise seems good to merge as I think 4000 seems to be consensual enough. And maybe a dedicated PR for |
This makes it possible to view far away objects without having to tweak any settings. This results in a more usable editor when working on large-scale levels. This change should have no impact on performance, but note that Z-fighting will be visible at a distance. This can be made less visible by increasing the Znear value (however, doing so will cause nearby surfaces to disappear). This change was also applied to the editor, but it will only apply to newly created scenes. This also changes the default camera settings in the glTF importer to match the Camera node's defaults.
42dafc2
to
7ae487d
Compare
Rebased.
We'll have to fix the issue with SSAO artifacting in |
Thanks! |
This makes it possible to view far away objects without having to tweak any settings. This results in a more usable editor when working on large-scale levels.
This change should have no impact on performance, but note that Z-fighting will be visible at a distance. This can be made less visible by increasing the Znear value (however, doing so will cause nearby surfaces to disappear).
This change was also applied to the editor, but it will only apply to newly created scenes.
This also changes the default camera settings in the glTF importer to match the Camera node's defaults.
cc @lawnjelly, as he inspired me to do this in #32764. I also considered increasing the default Znear value back to 0.1 for better depth buffer precision, but this may not be a good idea as many games may be putting the camera close to walls/floors.
This closes godotengine/godot-proposals#853.