Iris reordering draw calls for GeckoLib4 render layers [1.21.1]

Iris seems to be reorganizing draw calls for GeckoLib4 render layers. I'm drawing using a GeoEntityRenderer that is sensitive to the order in which the draw calls occur, and when Iris is installed the order gets messed up. Notably this doesn't happen with Sodium installed but not Iris. I have some RenderDoc captures, one with the issue occuring (with Iris installed) and one without the issue occuring (with just Sodium installed). Code snippet with the intended order (glow, claws, armor, item) but in the screenshot with the issue, the armor ends up rendering before the glow layer, causing the glow layer to overlay on top of the armor.
public DragonRenderer(final EntityRendererProvider.Context context, final GeoModel<DragonEntity> model) {
super(context, model);

getRenderLayers().add(new DragonGlowLayerRenderer(this));
getRenderLayers().add(new ClawsAndTeethRenderLayer(this));
getRenderLayers().add(new DragonArmorRenderLayer(this));
getRenderLayers().add(new DragonItemRenderLayer(this, (bone, animatable) -> {
if (bone.getName().equals(ClientDragonRenderer.renderItemsInMouth ? "RightItem_jaw" : "RightItem")) {
return animatable.getMainHandItem();
} else if (bone.getName().equals(ClientDragonRenderer.renderItemsInMouth ? "LeftItem_jaw" : "LeftItem")) {
return animatable.getOffhandItem();
}
return null;
}, (bone, animatable) -> null));
}
public DragonRenderer(final EntityRendererProvider.Context context, final GeoModel<DragonEntity> model) {
super(context, model);

getRenderLayers().add(new DragonGlowLayerRenderer(this));
getRenderLayers().add(new ClawsAndTeethRenderLayer(this));
getRenderLayers().add(new DragonArmorRenderLayer(this));
getRenderLayers().add(new DragonItemRenderLayer(this, (bone, animatable) -> {
if (bone.getName().equals(ClientDragonRenderer.renderItemsInMouth ? "RightItem_jaw" : "RightItem")) {
return animatable.getMainHandItem();
} else if (bone.getName().equals(ClientDragonRenderer.renderItemsInMouth ? "LeftItem_jaw" : "LeftItem")) {
return animatable.getOffhandItem();
}
return null;
}, (bone, animatable) -> null));
}
1 Reply
Seelder
SeelderOP2w ago
This is on Iris 1.8.1, GeckoLib4 4.7.3, and Sodium 0.6.1

Did you find this page helpful?