-
Notifications
You must be signed in to change notification settings - Fork 0
26.1.2 Mob Crowd Overdraw Defense
Dasik edited this page Aug 20, 2026
·
1 revision
Dense mob farms, villager trading halls, and animal breeding pens can cause extreme framerate drops when hundreds of entities are stacked within a few blocks. While GPU Early-Z rasterization handles basic depth testing, extracting and submitting hundreds of mob skeletal hierarchies overloads CPU render dispatchers.
Camera Culling provides an optional, safeguarded crowd overdraw defense system.
| Property | Value |
|---|---|
| Config Key |
cullEntitiesBehindEntities (Default: false) |
| Cluster Density Cap |
maxEntitiesPerCluster (Default: 8 mobs / 1.5 blocks) |
| Distance Fast-Fail |
|
| Cluster Search Radius | targetBox.inflate(1.5) |
| Exempt Entities | Transparent / Decorative mobs (Vex, ArmorStand, ItemFrame, Slime, MagmaCube) |
In large open fields with dispersed cow herds, running spatial queries across all mobs causes unnecessary CPU overhead. In modern versions of Camera Culling, crowd overdraw culling enforces an immediate 16-meter distance fast-fail:
public static boolean isEntityOccludedByCloserEntities(Entity target, Level level, Vec3 camPos, AABB targetBox, double targetDistSq) {
if (target == null || level == null || camPos == null) {
return false;
}
// Fast-fail: only apply crowd overdraw culling within 16 meters
if (targetDistSq > 256.0) {
return false;
}
// 1. Cluster Density Cap in tight 1.5-block sphere
int maxCluster = CameraCullingConfig.getMaxEntitiesPerCluster();
AABB clusterBox = targetBox.inflate(1.5);
List<Entity> clusterEntities = level.getEntities(target, clusterBox,
e -> e instanceof LivingEntity && !isTransparentOrDecorative(e));
if (clusterEntities.size() < maxCluster) {
return false;
}
int closerInCluster = 0;
for (Entity e : clusterEntities) {
double distSq = camPos.distanceToSqr(e.getX(), e.getY(), e.getZ());
if (distSq < targetDistSq) {
closerInCluster++;
if (closerInCluster >= maxCluster) {
return true; // Culled due to cluster density cap
}
}
}
return false;
}- Zero Open-Field Overhead: Mobs grazing beyond 16 meters skip entity search sweeps entirely.
- Dense Pen Protection: In 1x1 or 2x2 mob grinder pens where 50+ cows/zombies are packed, rendering is capped to the frontmost 8 entities, eliminating lag spikes.
Camera Culling Documentation • Part of the Vanilla Outsider Collection
Author: Dasik (Rifaditya) • Licensed under GNU General Public License v3.0 (GPLv3)
📌 Repository Source Disclaimer: The documentation in this Wiki reflects the current source code state in the repository, which may include recent unreleased commits ahead of public release builds on CurseForge/Modrinth.
- MC 26.3 Overview
- Entity Occlusion Culling
- Block Entity Culling
- Sign & Hanging Sign Culling
- Particle & Animation Culling
- Mob Crowd Overdraw Defense
- Distance Texture LOD
- Boss & Blacklist Immunity
- Temporal Hysteresis & Math
- Commands & Configuration
- GUI Configuration (YACL)
- Debug Tracing & Diagnostics
- Architecture & Mixins
- Developer Setup & Building
- API & Mod Integration
- MC 26.2 Overview
- Entity Occlusion Culling
- Block Entity Culling
- Sign & Hanging Sign Culling
- Particle & Animation Culling
- Mob Crowd Overdraw Defense
- Distance Texture LOD
- Boss & Blacklist Immunity
- Temporal Hysteresis & Math
- Commands & Configuration
- GUI Configuration (YACL)
- Debug Tracing & Diagnostics
- Architecture & Mixins
- Developer Setup & Building
- API & Mod Integration
- MC 26.1.2 Overview
- Entity Occlusion Culling
- Block Entity Culling
- Sign & Hanging Sign Culling
- Particle & Animation Culling
- Mob Crowd Overdraw Defense
- Distance Texture LOD
- Boss & Blacklist Immunity
- Temporal Hysteresis & Math
- Commands & Configuration
- GUI Configuration (YACL)
- Debug Tracing & Diagnostics
- Architecture & Mixins
- Developer Setup & Building
- API & Mod Integration