mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-18 03:44:54 -04:00
fix entity frustum culling
This commit is contained in:
parent
65e62441a8
commit
a34e7c907b
@ -65,13 +65,13 @@ class VisibilityManager(val renderer: EntitiesRenderer) {
|
||||
renderer.updateRenderInfo(millis)
|
||||
}
|
||||
if (!renderer.isInRenderDistance()) {
|
||||
return renderer.updateVisibility(true, true)
|
||||
return renderer.updateVisibility(true, false)
|
||||
}
|
||||
val aabb = renderer.entity.renderInfo.cameraAABB
|
||||
val visible = aabb in frustum
|
||||
if (!visible) {
|
||||
// TODO: renderer/features: renderOccluded -> occlusion culling is faster than frustum culling
|
||||
return renderer.updateVisibility(true, true)
|
||||
return renderer.updateVisibility(true, false)
|
||||
}
|
||||
val occluded = graph.isAABBOccluded(aabb)
|
||||
renderer.updateVisibility(occluded, true)
|
||||
|
Loading…
x
Reference in New Issue
Block a user