Need help with rendering.

I'm trying to fix my mod compat with Iris, but when Iris installed, all blocks and entities renders over my beams. Nothing of depth test, target, transparency and overlay doesn't help. Only if I set writeMaskState to ALL_MASK, it helps, but alpha channel cutoff all blocks inside texture.
No description
No description
56 Replies
Ensō
EnsōOP2mo ago
All layers has translucent state
No description
Ensō
EnsōOP2mo ago
This is how it renders without Iris:
No description
Ensō
EnsōOP2mo ago
MC 1.21.4 Fabric, Sodium 0.6.6, Iris 1.8.5 ... Any help please?
Quaza
Quaza2mo ago
Seems like noone who knows anything about this has checked this qwq I happen to know about this mod and would like to see it get fixed too-
IMS
IMS2mo ago
h i am here This sounds just like the entity sorting working correctly however, it can be bypassed by setting your render layer to have a specific translucency mode (although not ideal...) actually wait no BER doesn't exist for terrain... I'd need to see how it's being rendered (the full render layer definition)
Ensō
EnsōOP2mo ago
public static RenderLayer droplightBase(Identifier texture) {
RenderLayer.MultiPhaseParameters state = RenderLayer.MultiPhaseParameters.builder()
.texture(new RenderPhase.Texture(texture, TriState.FALSE, false))
.program(new RenderPhase.ShaderProgram(LootBeamShaders.getShader(LootBeamShaders.DroplightShader.DROPLIGHT_BASE)))
.writeMaskState(RenderPhase.COLOR_MASK)
.cull(RenderPhase.DISABLE_CULLING)
.transparency(RenderPhase.TRANSLUCENT_TRANSPARENCY)
.build(false);

return RenderLayer.of(
"loot_beam_droplight_base",
CustomVertexFormats.POSITION_TEX_COLOR0_COLOR1_CUSTOM,
VertexFormat.DrawMode.QUADS,
1536,
false,
true,
state
);
}
public static RenderLayer droplightBase(Identifier texture) {
RenderLayer.MultiPhaseParameters state = RenderLayer.MultiPhaseParameters.builder()
.texture(new RenderPhase.Texture(texture, TriState.FALSE, false))
.program(new RenderPhase.ShaderProgram(LootBeamShaders.getShader(LootBeamShaders.DroplightShader.DROPLIGHT_BASE)))
.writeMaskState(RenderPhase.COLOR_MASK)
.cull(RenderPhase.DISABLE_CULLING)
.transparency(RenderPhase.TRANSLUCENT_TRANSPARENCY)
.build(false);

return RenderLayer.of(
"loot_beam_droplight_base",
CustomVertexFormats.POSITION_TEX_COLOR0_COLOR1_CUSTOM,
VertexFormat.DrawMode.QUADS,
1536,
false,
true,
state
);
}
This is just one of layers, but all has translucent state
IMS
IMS2mo ago
.writeMaskState(RenderPhase.COLOR_MASK)
making it color-only seems like the wrong thing for what you want but seeing your photo about the alpha channel that sounds like your shader code is wrong
Ensō
EnsōOP2mo ago
I can show shader code
IMS
IMS2mo ago
is it just lootbeams_droplight?
Ensō
EnsōOP2mo ago
Just?
IMS
IMS2mo ago
i'm looking at the latest modrinth version
Ensō
EnsōOP2mo ago
I have local changes what don't upload now, because want to fix that bug
IMS
IMS2mo ago
:waaaa:
Ensō
EnsōOP2mo ago
1 min, I send shader
IMS
IMS2mo ago
this is why git is important :ioa:
Ensō
EnsōOP2mo ago
Git private, I can add you as contributor if you want
IMS
IMS2mo ago
sure
Ensō
EnsōOP2mo ago
Ill send invite All layers in render/LootBeamRenderLayers
IMS
IMS2mo ago
okay, well droplight_base doesn't have any alpha test
Ensō
EnsōOP2mo ago
Last changes in 1.21.4 branch
IMS
IMS2mo ago
oh it's blended i see
Ensō
EnsōOP2mo ago
I'm so bad at rendering, sorry
IMS
IMS2mo ago
no problem it's not really about what you know, just having the right tools (and being on Linux :cshrug:) what do i need to do to replicate the bug? i already have Iris loaded in oh i see
Ensō
EnsōOP2mo ago
Just Iris and sodium. I have 2 different renders for beam for droplight and lootbeam modes In lootbeam center renders because lightning layer has ALL_MASK
IMS
IMS2mo ago
okay
Ensō
EnsōOP2mo ago
If I could, I would have fixed it myself, but unfortunately, as you can see, I couldn't ( Thanks for agreeing to help
IMS
IMS2mo ago
the render is just happening at the completely wrong time
IMS
IMS2mo ago
No description
IMS
IMS2mo ago
:ioa: not sure why, need to look into it more
Ensō
EnsōOP2mo ago
I think it's because renders after all 1 sec
IMS
IMS2mo ago
it's rendering before anything
Ensō
EnsōOP2mo ago
WorldRendererMixin
IMS
IMS2mo ago
i see you fell for the classic "get fucked" renderWeather does not, in fact, render the weather this is a new thing in 1.21.4 that many people get confused about let me see if I can write the fix quickly
Ensō
EnsōOP2mo ago
TNANKS I hook into that, beacause in default render, it render beam after all translucents and water And clouds Also I have 2 renders, particles must render after beam
IMS
IMS2mo ago
well, it seems you tried to account for this with the whole frameGraphBuilder thing but that whole system is inconsistent hm, that didn't fix it...
Ensō
EnsōOP2mo ago
I hope we’ll be able to fix this after all
IMS
IMS2mo ago
okay this whole "event" system is overcomplicated for such simple uses :ioa: you really don't need this
Ensō
EnsōOP2mo ago
You fix that?
IMS
IMS2mo ago
not fixing it all, but i'm fixing what's needed to make this work
Ensō
EnsōOP2mo ago
I feel uncomfortable knowing that I'm interrupting you from working on the update and the new shader system, but I also understand that I can't figure it out on my own, sorry again (
IMS
IMS2mo ago
it's fine
Ensō
EnsōOP2mo ago
Thanks
IMS
IMS2mo ago
cfixed
No description
IMS
IMS2mo ago
the fix is very overcomplicated for what it does but it does work
Ensō
EnsōOP2mo ago
Wow, that was fast
IMS
IMS2mo ago
IMS
IMS2mo ago
(If you’re using IDEA just drag and drop it)
Ensō
EnsōOP2mo ago
Yes, I know, testing it RN If something don't work, I say about it Thank you so much! All works perfect Just TNANKS It also fixed lightning layer overlay What doesn't work before @IMS Can I ask about something else? I also adding new VertexFormatElement's, and some indexes sometimes collides with Iris. RN I fix that by hardcode Iris indexes, and don't override them Maybe Iris have method for getting that indexes as list? Just for more compatibility, mod can get indexes and not try to register their Formats on Iris indexes
IMS
IMS2mo ago
You can check against the ID’s I really don’t recommend adding more formats, though… maybe you can get what you want by using NORMAL as the second color
Ensō
EnsōOP2mo ago
I need not only second color, also UV size and some more data, like item time for animated beam etc. Because ground glow effects use texture sheet Ahhh, done with compat. Also add using isShaderPackInUse for layers to switch to another method of rendering
Ensō
EnsōOP2mo ago
Without shaders, as planned with custom core shaders
No description
Ensō
EnsōOP2mo ago
With complementary shaders and switch to entity translucent layer
Ensō
EnsōOP2mo ago
And without droplight mode with shaders
hardester
hardester2mo ago
Holy shit, those are impressive effects. :pog:
Slooshie
Slooshie2mo ago
Indeed. Looks very magical
Ensō
EnsōOP2mo ago
@IMS Find out another way to fix, more simplier. Because of you just update getting consumers, I remember about using this for trails:
// var consumerProvider = MinecraftClient // Another variant to fix
// .getInstance()
// .getBufferBuilders()
// .getEntityVertexConsumers();
// var consumerProvider = MinecraftClient // Another variant to fix
// .getInstance()
// .getBufferBuilders()
// .getEntityVertexConsumers();
And this also works, if I just replace consumer to this. Just FYI

Did you find this page helpful?