godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.42k stars 21.26k forks source link

XRCamera3D Far plane higher than 699050 only renders sky #88784

Open tiggerntatie opened 9 months ago

tiggerntatie commented 9 months ago

Tested versions

System information

Godot v4.2.1.stable - Windows 10.0.22621 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4070 Ti (NVIDIA; 31.0.15.5123) - 13th Gen Intel(R) Core(TM) i5-13600KF (20 Threads) - using Vive Pro on Steam VR Version 2.4.1

Issue description

XRCamera3D Far plane values up to 699050 work as expected. When the Far value is set to 699051 or higher, meshes present in the scene are not displayed in the headset or the monitor. The sky is displayed correctly in both cases.

Steps to reproduce

Clone or download the Godot project from github. Set the XRCamera3D Far value to 699050 and observe that the plane mesh is present in the VR view when running the project. Set the XRCamera3D Far value to 699051 and observe that the plane mesh is not present in the VR view.

Minimal reproduction project (MRP)

Download the zipped project from: https://github.com/tiggerntatie/XRFarMRP/releases/tag/0.0.1

Calinou commented 9 months ago

This likely depends on the Near property set in the XRCamera3D as well (higher values make it possible to use higher Far values).

An easy solution that works with the default Near value is to do the same as https://github.com/godotengine/godot/pull/82415 and clamp the Far value to 699050 in the setter. This will work with Near values higher than the default, but not necessarily with values lower than the default.