Skip to content

26.3 Entity Occlusion Culling

Dasik edited this page Aug 20, 2026 · 1 revision

🧱 Entity Occlusion Culling (Minecraft 26.3)

In Minecraft 26.3, the client entity rendering pipeline extracts render states (EntityRenderState) for all entities inside the camera frustumβ€”even if they are hidden behind mountains, thick stone walls, or underground dungeons. Camera Culling intercepts this check to prevent occluded mobs from consuming CPU geometry processing and GPU draw calls.


πŸ“‹ Entity Culling Infobox

Property Value
Target Pipeline EntityRenderer.shouldRender(T, Frustum, double, double, double)
Default Profile SUPER (Extreme)
Clip Context ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE
Floor Filtering Ignores Direction.UP hits when hit height $\le Y + 0.15\text{m}$
Leaves Occlusion Solid render and BlockTags.LEAVES blocks occlude sightlines
Immunity Bubble Distance squared $< \text{minDistanceSq}$

πŸ”¬ Multi-Point Anatomical Sightline Sampling

Instead of a simplistic single-point raycast that causes mobs to pop in and out around corners, Camera Culling performs multi-point anatomical sampling based on the selected Culling Profile:

       [1] Head Top (maxY - 0.05)
          \
           [2] Eye Position (entity.getEyeY())
            \
             [3] Upper Torso (minY + height * 0.70)
              \
               [4] Center of Mass (centerY)
                \
        [5-8] Elevated Perimeter Flanks (width/depth checks)
  1. Sample 1: Top of Entity Head (maxY - 0.05)
    • High priority check. Detects tall entities peeking over low barricades or fences.
  2. Sample 2: Anatomical Eye Position (getEyeY())
    • Direct line-of-sight from camera to mob eyes.
  3. Sample 3: Upper Torso / Chest (minY + height * 0.70)
    • Evaluates upper body sightlines safely above ground level.
  4. Sample 4: Center of Mass ((minY + maxY) * 0.5)
    • General geometric midpoint test.
  5. Sample 5–8: Elevated Perimeter Flanks
    • Evaluates $(X_{\min} + 0.15, Z_{\min} + 0.15)$, $(X_{\max} - 0.15, Z_{\min} + 0.15)$, etc. Ensures wide bosses (e.g. Ravagers, Wardens, Spiders) are visible when their shoulders emerge from behind corners.

πŸ›‘οΈ Directional Floor & Slope Filtering

When a player looks downward at a mob standing on uneven terrain, a standard raycast can strike the top surface of a block near the mob's feet, falsely treating the floor as an occluding wall.

Camera Culling incorporates Directional Floor Hit Filtering: $$\text{If } \text{hit.getDirection()} == \text{Direction.UP} \quad \text{and} \quad Y_{\text{hit}} \le Y_{\text{target}} + 0.15\text{m} \implies \text{Valid Sightline (Not Blocked)}$$

This guarantees that mobs traversing hills, staircases, and irregular terrain are never erroneously culled.


⚑ Zero-Allocation Raycast Engine

In previous implementations, evaluating 8 sample points across 100 entities generated over 180,000 new Vec3() heap allocations per second, resulting in JVM Young-Gen garbage collection pauses.

In 26.3, CullingRaycastHelper passes raw primitive coordinates:

public static boolean hasLineOfSight(Level level, Vec3 from, double toX, double toY, double toZ)

This architecture completely eliminates intermediate heap allocations on every frame.


πŸ”— Related Pages

Clone this wiki locally