You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-14 13:41:12 +00:00
Merge pull request #43506 from QbieShay/fix-depth-sort
[3.x] VisualServer now sorts based on AABB position
This commit is contained in:
@@ -2096,8 +2096,8 @@ void VisualServerScene::_prepare_scene(const Transform p_cam_transform, const Ca
|
|||||||
|
|
||||||
geom->gi_probes_dirty = false;
|
geom->gi_probes_dirty = false;
|
||||||
}
|
}
|
||||||
|
Vector3 aabb_center = ins->transformed_aabb.position + (ins->transformed_aabb.size * 0.5);
|
||||||
ins->depth = near_plane.distance_to(ins->transform.origin);
|
ins->depth = near_plane.distance_to(aabb_center);
|
||||||
ins->depth_layer = CLAMP(int(ins->depth * 16 / z_far), 0, 15);
|
ins->depth_layer = CLAMP(int(ins->depth * 16 / z_far), 0, 15);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user