✨ Particle & Animation Occlusion Culling (Minecraft 26.2)
In vanilla Minecraft, subterranean lava drips, cave dust, portal particles, and torches generate hundreds of particle quads behind solid stone walls that are submitted to the GPU. Simultaneously, animated block texture atlases continually upload frame data to the GPU even when the player is paused in singleplayer or sitting in modal menus.
Camera Culling introduces high-speed particle line-of-sight checks and atlas upload suppression.
📋 Particle & Animation Culling Infobox
| Property | Value |
|---|---|
| Particle Target | SingleQuadParticle.extract(QuadParticleRenderState, Camera, float) |
| Animation Target | TextureAtlas.cycleAnimationFrames() |
| Proximity Safety | 4.0 meters ($16.0\text{m}^2$) around camera |
| Max Particle Distance | 64.0 meters ($4096.0\text{m}^2$) |
| Atlas Pause Trigger | Singleplayer game paused OR no active level/player |
🌪️ Particle Occlusion Pipeline
text
Particle Generated at (X, Y, Z)
│
▼
[1] Distance <= 4m? ──────────► RENDER (Proximity Bubble)
│ No
▼
[2] Distance > 64m? ──────────► CULL (Far Cutoff)
│ No
▼
[3] Inside Solid Block? ──────► CULL (Encased)
│ No
▼
[4] Visual Clip Raycast Blocked?
├── Yes ──────────────► CULL (Occluded)
└── No ───────────────► RENDER (Visible)- Proximity Safety Bubble (4.0m): Particles emitted within 4 meters of the camera are rendered unconditionally in $< 0.0001\mu\text{s}$.
- Far Distance Cutoff (64.0m): Particles generated beyond 64 meters are culled to protect GPU quad fillrate.
- Solid Block Enclosure: If the block coordinate
BlockPos.containing(x, y, z)hasisSolidRender() == true, the particle is dropped immediately. - Visual Clip Raycast: Projects a
ClipContext.Block.VISUALray from camera position to the particle vector. If an opaque solid block intercepts the sightline with $> 0.35\text{m}$ margin, rendering is skipped.
🎬 Block & Texture Atlas Animation Freezing
Texture atlas animations consume GPU bandwidth to cycle frame indices.
Camera Culling checks AnimationCullingHelper.shouldPauseAtlasAnimation() in TextureAtlasMixin:
- If singleplayer is paused (
mc.isPaused() == true), atlas uploads are frozen. - If sitting on the title screen, in modal menus, or disconnected from world, background texture cycling is halted.
