Double rendering of Armor with AzureLib

Got a report of Armor being rendered at the Curser when wearing armor or looking at armor when using my Geckolib fork AzureLib. After doing some digging, it seems to be down to this line here: https://github.com/AzureDoom/AzureLib/blob/1.20/Fabric/src/main/java/mod/azure/azurelib/renderer/GeoArmorRenderer.java#L281 and having Real-Time Shadows on. Any suggestions would be welcome.
38 Replies
Daedelus
Daedelusā€¢14mo ago
Hello @Head Developer , this issue effecting thousands of players in a consistant manner. Could you reply to the github issue by shedding some light on the potential ways to resolve it?
IMS
IMSā€¢14mo ago
Any armor or specific armor? if it's specific armor i need a mod that causes it
AzureDoom
AzureDoomā€¢14mo ago
It's any armor that's done using the GeoArmorRender (this is seen both in Geckolib itself and my fork AzureLib). Daedelus found it in his mod wizards and I was able to produce it with a test armor in my fork, I can push a version with that test armor if you'd like.
IMS
IMSā€¢14mo ago
no, i can just put wizards in the dev env it's fine just needed to know that
AzureDoom
AzureDoomā€¢14mo ago
Alright! It's got a lot of dependencies just a heads up.
IMS
IMSā€¢14mo ago
hm, it's saying it wants geckolib specifically so maybe i will need that test build actually lol
AzureDoom
AzureDoomā€¢14mo ago
Give me about 10 minutes here and I'll have it up on my maven for you!
IMS
IMSā€¢14mo ago
I'm building your mod to make it easier to debug so just source works
AzureDoom
AzureDoomā€¢14mo ago
Ah, the test armor wasn't pushed to my github, let me do a branch for that real fast.
IMS
IMSā€¢14mo ago
you can ping me when it's up and i'll take a look
AzureDoom
AzureDoomā€¢14mo ago
@IMS https://github.com/AzureDoom/AzureLib/tree/1.20-iristesting here you go! Just need to add Iris and Sodium to the runs mod folder (it's what I do anyway).
GitHub
GitHub - AzureDoom/AzureLib at 1.20-iristesting
Based off Geckolib but now just for my own needs. - GitHub - AzureDoom/AzureLib at 1.20-iristesting
AzureDoom
AzureDoomā€¢14mo ago
https://www.complementary.dev/shaders-v4/ is the shader I'm testing with as well.
Complementary Shaders v4 | Official Site
Complementary Shaders Version 4 is the original Complementary Minecraft Java Edition shader pack based on Capt Tatsu's BSL Shaders. The goal of Complementary v4 is being good at everything. Performance, gameplay, beauty, compatibility; you name it. Complementary v4 will try to provide you with the most issueless experience possible within limita...
IMS
IMSā€¢14mo ago
šŸ‘ v4 is actually being removed on friday fyi does it happen with reimagined?
AzureDoom
AzureDoomā€¢14mo ago
Oh, let me test real fast
IMS
IMSā€¢14mo ago
got the bug this seems like a pretty standard case of shadows being rendered in the wrong image though I wouldn't know why lemme see what i can do
AzureDoom
AzureDoomā€¢14mo ago
Alright!
IMS
IMSā€¢14mo ago
public static double getCurrentTick() {
return Blaze3D.getTime() * 20d;
}
public static double getCurrentTick() {
return Blaze3D.getTime() * 20d;
}
this really doesn't seem right why are you not just using the world tick?
AzureDoom
AzureDoomā€¢14mo ago
That was something from both Gecko/Tslat. That's a good point though and I'll test that out.
IMS
IMSā€¢14mo ago
either way, the issue seems to be poseStack is retained from the shadow pass It seems the core issue just lies with the fact you can't call render twice in one frame and have it work and you need to do something with reRender that won't work, because the shadow pass kinda relies on that idea for some reason your armor is taking the shadow pass's PoseStack but nothing else OK i think I know what's going on somehow, you're grabbing the player's RenderBuffers in what should be a shadow call this defers whatever you're trying to render to happen way later than it should the getArmorFoilBuffer is what's replacing the correct RenderBuffers which is why it seems like that's the bug
Daedelus
Daedelusā€¢14mo ago
Clarification: - AzureLib is a fork of GeckoLib - The issue happens any armor is rendered using GeoArmorRenderer (from either AzureLib or GeckoLib) - Wizards is specifically using GeckoLib.
IMS
IMSā€¢14mo ago
wait i think i fixed it
Daedelus
Daedelusā€¢14mo ago
šŸ‘€ šŸ¤ž
IMS
IMSā€¢14mo ago
I can fix this in Iris, and AzureLib can also fix this realistically it doesn't matter which one so I'll just throw a fix into Iris
Daedelus
Daedelusā€¢14mo ago
You are living god
AzureDoom
AzureDoomā€¢14mo ago
Sweet, what's the fix?
Daedelus
Daedelusā€¢14mo ago
Both of you
IMS
IMSā€¢14mo ago
You're grabbing mc.renderBuffers() but Iris never updates that it updates mc.levelRenderer.renderBuffers
IMS
IMSā€¢14mo ago
this should fix it if i'm right
IMS
IMSā€¢14mo ago
I can also PR a fix to AzureLib
AzureDoom
AzureDoomā€¢14mo ago
The fix would just be call renderBuffers, which just requires an quick AW to fix I assume?
IMS
IMSā€¢14mo ago
AW or mixin accessor yeah This does not fix it, because mc.renderBuffers is final so you will need to fix it on your side
AzureDoom
AzureDoomā€¢14mo ago
That fixed it perfectly @IMS thanks again!
Daedelus
Daedelusā€¢14mo ago
Thank you hedg hog for helping!
Tslat
Tslatā€¢14mo ago
Wait hang on so iris only patches one reference to render buffers but doesn't patch others even though they're the same object ? Why should iris not be fixing that? ?
IMS
IMSā€¢14mo ago
the minecraft class version is final and it doesn't conform to logic levelRenderer renders the level, and should have it changed the other one doesn't
Tslat
Tslatā€¢14mo ago
it's the exact same buffer it's literally the same object
IMS
IMSā€¢14mo ago
2 different storages for the same object yeah point is if you're rendering the level you go to LevelRenderer if it's the GUI, you actually don't want the replaced one and use Minecraft
Tslat
Tslatā€¢14mo ago
shouldn't it be made significantly clearer that iris replaces the default buffer getter then if that's the case? lol you're ghost-swapping the render buffers outright, but only in one place and not others, which is an invisible inconsistency you're saying you're doing it intentionally to keep compatibility for other modders, but for other modders to even know that they'd basically have to get lucky or just outright guess iris is breaking something invisibly
Want results from more Discord servers?
Add your server