Merge pull request #43506 from QbieShay/fix-depth-sort
[3.x] VisualServer now sorts based on AABB position
This commit is contained in:
commit
4100a80502
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue