Iris with shader enabled breaks BlockEntity rendering

the following code works perfect without shader loaded, but with a iris shader loaded it does not render anything
12 Replies
Marvin
MarvinOP4mo ago
Slooshie
Slooshie4mo ago
is this a vanilla shader?
Marvin
MarvinOP4mo ago
no, it is a slightly modified RENDERTYPE_ENTITY_TRANSLUCENT_SHADER copied from the minecraft shaders to have lightmap coords as uniforms
Slooshie
Slooshie4mo ago
so it's a vanilla shader. they are not compatible with Iris and they won't be for the foreseeable future
Marvin
MarvinOP4mo ago
so what should i do?
hardester
hardester4mo ago
Lightmap coord as it the light's intensity, or something else?
Marvin
MarvinOP4mo ago
the ones you get in the BlockEntity render method for optimization i pre-compute the mesh and only change the light dynamically because i pre-compute the mesh i can not bake in the lightmap coordinates because it would not change in the daycycle so I place them as uniform in the shader this improves render time for the blockentity from 0.1-0.4ms to <0.005ms and there can be a lot of blockentities
hardester
hardester4mo ago
:Render_Thinking: This is, probably something that @IMS can answer. Or someone in the contributor team at least.
Marvin
MarvinOP4mo ago
https://www.youtube.com/watch?v=HRoTLI7ZUdI this is what my mod does if it helps to figure out an answer
Marvin
MarvinOP4mo ago
@IMS pls help me
hardester
hardester4mo ago
No need to ping him twice. I've already informed him of your issue report.
Marvin
MarvinOP4mo ago
thank you this code does render it (wrong vertex position because it is missing the transformation) but still, renders. but it is extremly slow because i create the mesh every frame and upload it to gpu. in my above code i use almost exactly the same logic like the below code uses (I looked at the decompiled code) and the only big difference is that i store the data in a vertexbuffer now.
@Override
public void render(EntityPipe tile, float partialTick, PoseStack stack, MultiBufferSource bufferSource, int packedLight, int packedOverlay) {

VertexFormat vertexFormat = POSITION_COLOR_TEXTURE_NORMAL;
RenderType.CompositeState compositeState = RenderType.CompositeState.builder()
.setShaderState(RENDERTYPE_ENTITY_SOLID_SHADER)
.setOverlayState(OVERLAY)
.setLightmapState(LIGHTMAP)
.setTransparencyState(NO_TRANSPARENCY)
.setTextureState(new TextureStateShard(tile.renderData.spriteStill.atlasLocation(), false, false))
.createCompositeState(false);

RenderType r = RenderType.create("renderer_235646whatever", vertexFormat, VertexFormat.Mode.QUADS, 786432, false, true, compositeState);
VertexConsumer v = bufferSource.getBuffer(r);
RenderPipe.renderFluids(tile, v);
}
@Override
public void render(EntityPipe tile, float partialTick, PoseStack stack, MultiBufferSource bufferSource, int packedLight, int packedOverlay) {

VertexFormat vertexFormat = POSITION_COLOR_TEXTURE_NORMAL;
RenderType.CompositeState compositeState = RenderType.CompositeState.builder()
.setShaderState(RENDERTYPE_ENTITY_SOLID_SHADER)
.setOverlayState(OVERLAY)
.setLightmapState(LIGHTMAP)
.setTransparencyState(NO_TRANSPARENCY)
.setTextureState(new TextureStateShard(tile.renderData.spriteStill.atlasLocation(), false, false))
.createCompositeState(false);

RenderType r = RenderType.create("renderer_235646whatever", vertexFormat, VertexFormat.Mode.QUADS, 786432, false, true, compositeState);
VertexConsumer v = bufferSource.getBuffer(r);
RenderPipe.renderFluids(tile, v);
}
this does not render with iris shaders active, but does without
public static RenderType r =RenderType.entityTranslucentCull(TextureAtlas.LOCATION_BLOCKS);


@Override
public void render(EntityPipe tile, float partialTick, PoseStack stack, MultiBufferSource bufferSource, int packedLight, int packedOverlay) {
stack.translate(0.5f, 0.5f, 0.5f);
RenderPipe.renderFluids(tile, bufferSource.getBuffer(r), stack, packedLight, packedOverlay);
}
public static RenderType r =RenderType.entityTranslucentCull(TextureAtlas.LOCATION_BLOCKS);


@Override
public void render(EntityPipe tile, float partialTick, PoseStack stack, MultiBufferSource bufferSource, int packedLight, int packedOverlay) {
stack.translate(0.5f, 0.5f, 0.5f);
RenderPipe.renderFluids(tile, bufferSource.getBuffer(r), stack, packedLight, packedOverlay);
}
it works now

Did you find this page helpful?