[Legacy] GeckoLib Fabric

[Legacy] GeckoLib Fabric

3M Downloads

[1.20.1] Armor Render bug with Iris shaders

ZsoltMolnarrr opened this issue ยท 7 comments

commented

Minecraft version - 1.20.1
Mod loader - Fabric 0.14.22
Mod version - geckolib-fabric-1.20.1-4.2.2

The issue is present on 1.20.1 at least since Sodium 0.5.0 + Iris 1.6.5.

Describe the bug
When using any Iris shader, GeckoLib re-renders the Gecko armor worn by the client player in the distance.
image
image
image

armor_render_glitch-1.mov

This issue does not occur when wearing armor sets with vanilla armor model.

To Reproduce

  1. Install any mod (and all of its dependencies) that uses GeckoLib Armor Renderer featurset AND the latest version of Sodium and Iris. (In this example I install my own mod: Wizards and all of its depencies.)
  2. Install Sodium 0.5.2 and Iris 1.6.8
  3. Install any shaderpack (for example Complementary Shaders)
  4. Enter the game, equip a Gecko rendered armor set
  5. Look at the sky

The full modlist that was used to reproduce this scenario:

  • cloth-config-11.1.106-fabric.jar
  • fabric-api-0.87.0+1.20.1.jar
  • geckolib-fabric-1.20.1-4.2.2.jar
  • iris-mc1.20.1-1.6.8.jar
  • player-animation-lib-fabric-1.0.2-rc1+1.20.jar
  • runes-fabric-0.9.10+1.20.1.jar
  • sodium-fabric-mc1.20.1-0.5.2.jar
  • spell_engine-fabric-0.9.29+1.20.1.jar
  • spell_power-fabric-0.9.15+1.20.1.jar
  • trinkets-3.7.1.jar
  • wizards-fabric-0.9.20+1.20.1.jar

Note: This modlist is long due to how many dependencies Wizards has, any mod that is using GeckoLib armor renderer can reproduce this alongside Iris shaders.

Expected behavior
Worn armor rendered on the actual player model only, nowhere else in the viewport.

commented

Vouch - this is a very common issue

commented

Change https://github.com/bernie-g/geckolib/blob/main/Fabric/src/main/java/software/bernie/geckolib/renderer/GeoArmorRenderer.java#L267 to mc.levelRenderer.renderBuffers.bufferSource() which will require an AW for Fabric and an AT for Forge for LevelRenderer#renderBuffers

AW needed:

accessible field net/minecraft/client/renderer/LevelRenderer renderBuffers Lnet/minecraft/client/renderer/RenderBuffers;
mutable field net/minecraft/client/renderer/LevelRenderer renderBuffers Lnet/minecraft/client/renderer/RenderBuffers;

AT needed:

public-f net.minecraft.client.renderer.LevelRenderer f_109464_ # renderBuffers
commented

They're the same buffers

They're literally passed from mc to levelrenderer for storage
What's the context of this solution?

commented

I'm not in that discord

commented

Fixed in af3a0bd

commented

image