IrisShaders / Iris

A modern shaders mod for Minecraft compatible with existing OptiFine shader packs
https://irisshaders.dev
GNU Lesser General Public License v3.0
3.36k stars 642 forks source link

Horse markings render over horse armour #1365

Open Traben-0 opened 2 years ago

Traben-0 commented 2 years ago

What happened?

with iris-mc1.18.2-1.2.2-build.32 all horses render their markings over the top of their armour

I have reproduced this consistently with only iris and sodium installed and no resourcepacks used. simply load a world, tame a horse and place diamond horse armour on it

I don't know if this is relevant but horse armour uses the getEntityCutoutNoCull renderLayer and the markings use getEntityTranslucent, in vanilla atleast.

Screenshots

2022-04-12_20 51 17

Relevant log output

No response

Minecraft Version

Minecraft 1.18.2

Iris Version

iris-mc1.18.2-1.2.2-build.32.jar

Sodium Version

sodium-fabric-mc1.18.2-0.4.1+build.15.jar

Operating System

Windows 11

What is your GPU?

Nvidia Geforce RTX 3080

Java Version

Java 17

Additional context

No response

Traben-0 commented 2 years ago

also present in iris-mc22w15a-1.2.3-pre-f05b1251-dirty.jar

coderbot16 commented 2 years ago

I don't know if this is relevant but horse armour uses the getEntityCutoutNoCull renderLayer and the markings use getEntityTranslucent, in vanilla atleast.

This is indeed relevant and the underlying issue is that Iris Batched Entity Rendering is trying to ensure that translucent things render after other things, in the hopes that it solves issues like translucent slime parts not blending correctly with other entities.

However, in this case, it breaks since the translucent horse markings are being rendered after the non-translucent horse armor rather than the other way around.

Here's the part of the code that does the sorting based on the "transparency type":

https://github.com/IrisShaders/Iris/blob/fb22e63d775a8eaef9b184f1c6a04ddf5fa142a0/src/main/java/net/coderbot/batchedentityrendering/impl/ordering/GraphTranslucencyRenderOrderManager.java

VillagerNo96 commented 1 year ago

Same happens on the latest version (1.5.1) in 1.19.3

razorchase49 commented 1 year ago

Confirmed for version 1.5.2 for 1.19.4. So, how does this get fixed? Is there some sort of patch, or do we need to wait for an update?

Lolothepro commented 1 year ago

wait

razorchase49 commented 1 year ago

Confirmed for version 1.6.0

razorchase49 commented 1 year ago

Confirmed for version 1.6.1. I'm not a huge modder, but based on how things appear, it seems like the markings and armor textures on the horse are like layers. In this case, the markings are being applied or rendered after the horse armor, when it should be the other way around. The markings should be rendered before the armor, so that the armor overrides and covers those markings. I feel like changing the layer ordering should be relatively easy, please let me know if this isn't the case.

razorchase49 commented 1 year ago

Confirmed for version 1.6.2.

mrjasonn commented 9 months ago

Confirmed for version 1.6.17 with Minecraft 1.20.4 (maybe @IMS212 should collaborate with ImmediatelyFast lead developer @RaphiMC to fix this in both mods at once?)

HiiJax commented 7 months ago

I still plan on finding a better way to fix this, but for now I've made this mod that fixes this issue.

Lolothepro commented 1 month ago

fixed with Iris via Minecraft 1.21.2