You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Get the LOD support points on the mesh AABB.
Vector3 lod_support_min = inst->transformed_aabb.get_support(p_render_data->scene_data->cam_transform.basis.get_column(Vector3::AXIS_Z));
Vector3 lod_support_max = inst->transformed_aabb.get_support(-p_render_data->scene_data->cam_transform.basis.get_column(Vector3::AXIS_Z));
// Get the distances to those points on the AABB from the camera origin.
float distance_min = (float)p_render_data->scene_data->cam_transform.origin.distance_to(lod_support_min);
float distance_max = (float)p_render_data->scene_data->cam_transform.origin.distance_to(lod_support_max);
Both distances are always positive values, so the condition that checks if camera is inside AABB:
Tested versions
4.x as of 2d0ee20
System information
Any platform
Issue description
In the LOD system:
Both distances are always positive values, so the condition that checks if camera is inside AABB:
Never triggers.
Video: https://www.youtube.com/watch?v=j_rp_k5rDPA
Solution
To fix the issue - supplement
distance_min
with a sign, for example: roalyr@afbdb54Video: https://www.youtube.com/watch?v=LF21eYlb44Y
I am not opening a PR because I am not sure if this approach is the best.
Steps to reproduce
Set LOD bias to a really low value (0.1) and move camera inside AABB of a mesh, rotate the view.
Minimal reproduction project (MRP)
Irrelevant
The text was updated successfully, but these errors were encountered: