Iris Shaders

Iris Shaders

38M Downloads

AntiqueAtlas not rendering properly when Shaders are activated

tyra314 opened this issue ยท 6 comments

commented

What happened?

Hey, I've this open issue in AA, which I banged my head at against for a while now. In short, when shaders are activated, there are translucent pixels on the atlas, which should not be.

From my understanding, the tile textures of used in the Atlas use transparency, as well es the frame of the atlas. All these pixels with a smirch of transparency are completely gone. The code for drawing the atlas is here. To support the rendering with appropriate light value, I had to throw together my own code here. I suspect that I'm either using the wrong RenderLayer or I'm not supposed to have my own rendering in the first place.

I ran out of ideas how to fix it, hope you can provide some new pointers.

Screenshots

See this issue: AntiqueAtlasTeam/AntiqueAtlas#416

Log output

No response

Minecraft Version

Minecraft 1.18.2

Iris Version

Seen with Iris 1.1.3 and 1.5.0

Operating System

Linux

What is your GPU?

Nvidia 30 series

Additional context

No response

commented

What's going on is that Iris completely overrides hand rendering with it's custom shader for the hand. It seems like an overlay rendering after the level render might be better, though it might be better to just stop using a custom render layer. I'll look into it a bit more.

commented

One more thing I forgot. When fiddling with the render ordering like in this commit, the rendering suddenly looks like one would expect. However, that breaks the rendering without the shader. So technically speaking, I could use the IrisAPI and detect whether a shader is active and change the order of drawing. BUT, that sounds so freaking brittle, I guess that would stop working the second I commit that.

commented

What's going on is that Iris completely overrides hand rendering with it's custom shader for the hand. It seems like an overlay rendering after the level render might be better, though it might be better to just stop using a custom render layer. I'll look into it a bit more.

It's been two weeks and I haven't understood even half of what you said then. Can you elaborate a bit more? Especially, is there something that should be done to AntiqueAtlas rendering? Is there a simple solution in Iris? Or is this just one of those cases, where it's complicated and there's no feasible solution?

commented

The only option I could assume is manually choosing the hand render layer and trying it.

commented

To provide my own input - first, is this being rendered as part of the world, or is it an overlay on top after world rendering has completed? That makes a massive difference.

commented

To provide my own input - first, is this being rendered as part of the world, or is it an overlay on top after world rendering has completed? That makes a massive difference.

I'm not sure, if I can adequately answer that question, but I'll try. The rendering is triggered by a Mixin into the HeldItemRenderer or FirstPersonRenderer, for yarn and mojang mappings respectively. It basically doubles the code path for rendering vanilla map in the players hands up until the point of actual drawing it. IIRC vanilla maps are drawn using a prepared buffer, while AA is drawn on-the-fly. Originally all textures were drawn using the DrawableHelper.drawTexture/AbstractGui.blit method, but that doesn't support light values, so I came up with this abomination.