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ā€¢16mo 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ā€¢16mo ago
Any armor or specific armor? if it's specific armor i need a mod that causes it
AzureDoom
AzureDoomOPā€¢16mo 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ā€¢16mo ago
no, i can just put wizards in the dev env it's fine just needed to know that
AzureDoom
AzureDoomOPā€¢16mo ago
Alright! It's got a lot of dependencies just a heads up.
IMS
IMSā€¢16mo ago
hm, it's saying it wants geckolib specifically so maybe i will need that test build actually lol
AzureDoom
AzureDoomOPā€¢16mo ago
Give me about 10 minutes here and I'll have it up on my maven for you!
IMS
IMSā€¢16mo ago
I'm building your mod to make it easier to debug so just source works
AzureDoom
AzureDoomOPā€¢16mo ago
Ah, the test armor wasn't pushed to my github, let me do a branch for that real fast.
IMS
IMSā€¢16mo ago
you can ping me when it's up and i'll take a look
AzureDoom
AzureDoomOPā€¢16mo 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
AzureDoomOPā€¢16mo 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ā€¢16mo ago
šŸ‘ v4 is actually being removed on friday fyi does it happen with reimagined?
AzureDoom
AzureDoomOPā€¢16mo ago
Oh, let me test real fast
IMS
IMSā€¢16mo 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
AzureDoomOPā€¢16mo ago
Alright!
IMS
IMSā€¢16mo 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
AzureDoomOPā€¢16mo ago
That was something from both Gecko/Tslat. That's a good point though and I'll test that out.
IMS
IMSā€¢16mo 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ā€¢16mo 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ā€¢16mo ago
wait i think i fixed it
Daedelus
Daedelusā€¢16mo ago
šŸ‘€ šŸ¤ž
IMS
IMSā€¢16mo 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ā€¢16mo ago
You are living god
AzureDoom
AzureDoomOPā€¢16mo ago
Sweet, what's the fix?
Daedelus
Daedelusā€¢16mo ago
Both of you
IMS
IMSā€¢16mo ago
You're grabbing mc.renderBuffers() but Iris never updates that it updates mc.levelRenderer.renderBuffers
IMS
IMSā€¢16mo ago
this should fix it if i'm right
IMS
IMSā€¢16mo ago
I can also PR a fix to AzureLib
AzureDoom
AzureDoomOPā€¢16mo ago
The fix would just be call renderBuffers, which just requires an quick AW to fix I assume?
IMS
IMSā€¢16mo 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
AzureDoomOPā€¢16mo ago
That fixed it perfectly @IMS thanks again!
Daedelus
Daedelusā€¢16mo ago
Thank you hedg hog for helping!
Tslat
Tslatā€¢15mo 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ā€¢15mo 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ā€¢15mo ago
it's the exact same buffer it's literally the same object
IMS
IMSā€¢15mo 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ā€¢15mo 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