CC: Tweaked

CC: Tweaked

42M Downloads

Wrong render shader used for some GUI component rendering

VoidedMirror opened this issue ยท 11 comments

commented

Minecraft Version

1.20.x

Version

1.108.3

Details

All border_, pocket_, and sidebar_ textures are rendered using the rendertype_text shader instead of the preferred rendertype_gui shader.

commented

I'm working on a texture pack and i use the redertype_gui shader to recolor different text components. However some shades of gray in the gui textures i have are getting recolored to white. I believe the renderer used for the Turtles and the Disk drive textures are using the normal rendering method for UI elements (I'm not sure if this is specifically the rendertype_gui)

commented

Can you explain why you rendertype_gui is preferred? From what I can tell, this is only used when filling a solid colour. Indeed, rendertype_gui doesn't even accept a texture.

commented

Can you link your texture pack? rendertype_gui is never used for text rendering, so I suspect you're misdiagnosing what's going on.

commented

I don't believe it's a miss diagnosis. I tested with this resource pack that changes all elements using the rendertype_text frag shader to full red. Here are some screenshots of the computer and turtle for reference.
image
image
rtype_text_red.zip

commented

Ahhh, I assume you meant to say "rendertype_text" in "i use the redertype_gui shader to recolor different text components"?

I'm fear what you're trying to do here just won't work. The vanilla game (ab)uses the text rendertype for several other things (most prominently for held maps) - it's pretty much the only built-in rendertype which works for basic textured elements.

commented

Yes, I'm using the rendertype_text renderer to recolor text elements.

In recent versions of the game most of the rendering has been separated to different renderers. The rendertype_text renderer is only used to render text elements in the base Vanilla game. However, i have noticed that some mod implementations use various shaders to draw dynamic elements that use other vanilla shaders.

This mod is the only one i've come across that actually is using a rendertype_text shader to draw textures. Most of them are drawn correctly as is the case with how the textures are drawn for the Turtle and Computer. It might be that they use different draw methods that have different assigned render shaders? Or it could be an issue with how Forge rendering draws blitz textures and it naively assumes it should keep using the previously assigned shader for the remaining draws.

commented

but then why not define your own rendertype for that?

Unfortunately this tends to cause issues with shader mods like Iris. We're safe to do this with MONITOR_TBO as that's not compatible with shader mods anyway, but everywhere else we're careful to only use built-in render types.

commented

Found it, Line 60 in RenderTypes. You specify the rendertype to be a text shader for all GUI sprites.

image

commented

The rendertype_text renderer is only used to render text elements in the base Vanilla game.

I'm not quite sure about 1.20.2 (I'm hoping things are better there after the GUI sprite changes, but haven't checked), but on 1.20.1 this isn't the case for maps yet:

A screenshot of Minecraft with the player holding a map. The map is entirely red, as the resource pack from a previous message is being used.

The problem here is that there are no suitable substitutes for RenderType.text. There are no other RenderTypes which allow for rendering textures and colours, which is why a lot of mods (and vanilla itself!) end up using it.

commented

Hmm strange the modpack i'm testing on seems to change the map renderer so it's not affected by the text shader anymore. I do see the issue with needing to have a Rendertype that can be used to change the colors but then why not define your own rendertype for that?
I suppose i could alter the colors on my texture to not use those specific shades of gray.

commented

I think I understand now. This seems to be an intended behavior and not unintended as I originally thought. Since there is no easy alternative to using the text renderer it is probably just easier for me to implement my own work around in my resource pack, instead.