Skip to content

Fix horse rendering: culling when looking up + fire debug texture#899

Merged
codeHusky merged 1 commit intosmartcmd:mainfrom
MCbabel:fix/horse-rendering
Mar 8, 2026
Merged

Fix horse rendering: culling when looking up + fire debug texture#899
codeHusky merged 1 commit intosmartcmd:mainfrom
MCbabel:fix/horse-rendering

Conversation

@MCbabel
Copy link
Contributor

@MCbabel MCbabel commented Mar 8, 2026

Description

Fixes two horse rendering issues: the horse model disappearing when looking up while riding, and a debug texture showing instead of the fire overlay when a horse is on fire.

Changes

Fix 1: Horse disappears when looking up while riding

Previous Behavior:
The horse model would vanish when the player looked up while riding it.

Root Cause:
LevelRenderer::renderEntities() had no frustum culling exception for the entity the player is currently riding. The horse AABB ends at horse.y + 1.6, but the camera sits at horse.y + 2.82. When looking up, the entire horse AABB falls below the frustum and gets culled.

Fix:
Added an isPlayerVehicle check that skips frustum culling for the entity the player is riding.

Fix 2: Debug texture when horse is on fire

Previous Behavior:
When a horse, mule, or donkey was set on fire, it displayed a broken/debug texture instead of the normal fire overlay.

Before After
before after

Root Cause:
HorseRenderer::bindTexture() unconditionally calls bindTextureLayers(), even for single textures like the fire atlas. This reads the raw terrain.png instead of the runtime texture atlas.

Fix:
Modified HorseRenderer::bindTexture() to check getTextureCount(). Multi-layer horse textures still use bindTextureLayers(), single textures delegate to EntityRenderer::bindTexture().

Files Changed

  • Minecraft.Client/LevelRenderer.cpp - Added isPlayerVehicle culling bypass
  • Minecraft.Client/HorseRenderer.cpp - Fixed bindTexture() delegation

Related Issues

  • Reported on Discord (no GitHub issue)

- Skip frustum culling for the entity the player is currently riding, preventing the horse from disappearing when looking up (fixes a bug reported on Discord)

- Fix HorseRenderer::bindTexture() to delegate to base class for single textures (fire atlas, enchant glint), only using bindTextureLayers() for multi-layer horse textures
@codeHusky codeHusky merged commit cfcec48 into smartcmd:main Mar 8, 2026
1 check passed
retroohmygod pushed a commit to retroohmygod/astrasmcfork that referenced this pull request Mar 8, 2026
…artcmd#899)

- Skip frustum culling for the entity the player is currently riding, preventing the horse from disappearing when looking up (fixes a bug reported on Discord)

- Fix HorseRenderer::bindTexture() to delegate to base class for single textures (fire atlas, enchant glint), only using bindTextureLayers() for multi-layer horse textures

Co-authored-by: MCbabel <MCbabel@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants