Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AntiqueAtlas not rendering properly when Shaders are activated #1845

Open
tyra314 opened this issue Jan 15, 2023 · 6 comments
Open

AntiqueAtlas not rendering properly when Shaders are activated #1845

tyra314 opened this issue Jan 15, 2023 · 6 comments
Labels
bug Something is implemented incorrectly mod compatibility A compatibility issue with another mod

Comments

@tyra314
Copy link

tyra314 commented Jan 15, 2023

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

@tyra314 tyra314 added the bug Something is implemented incorrectly label Jan 15, 2023
@IMS212
Copy link
Member

IMS212 commented Jan 15, 2023

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.

@tyra314
Copy link
Author

tyra314 commented Jan 16, 2023

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.

@coderbot16 coderbot16 added the mod compatibility A compatibility issue with another mod label Jan 25, 2023
@tyra314
Copy link
Author

tyra314 commented Jan 29, 2023

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?

@IMS212
Copy link
Member

IMS212 commented Jan 29, 2023

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

@coderbot16
Copy link
Member

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.

@tyra314
Copy link
Author

tyra314 commented Jan 29, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is implemented incorrectly mod compatibility A compatibility issue with another mod
Projects
None yet
Development

No branches or pull requests

3 participants