Hello!
The tag doesn't quite fit but there isn't something better than this and since it's connect with block entities, I thought entities would be the best fit.
I am trying to make a custom text render layer to account for z-fighting problems I recently had and adding .layering() to the render layer seems to work for images at least and I also am trying to add this to the text currently but it does not work as expected. The text is just a bunch of pixel as in the image shows. I put the code into paste bin. The links are here:
https://pastebin.com/mU212uwY - CustomTextRenderer
https://pastebin.com/60tpRRhA - CustomRenderLayer
This is how I use the TextRenderer:
TextRenderer textRenderer = getTextRendererByPath(this.getFont().getFontPath());
CustomTextRenderer cTextRenderer = new CustomTextRenderer(textRenderer);
cTextRenderer.draw(
this.getText(),
0,0, 2.5f,
Color.toHexARGB(color),
false,
positionMatrix,
vertexConsumers,
CustomRenderLayer.TextLayering.LayeringType.VIEW_OFFSET_Z_LAYERING_BACKWARD,
0,
light
);
I tried to exactly replicate how the vanilla one works but obviously it doesn't work.
The vanilla one is creating RenderLayers for all fonts at initialization but this is not possible for me since I need to adjust the z coordinate dynamically depending on how far up it is in the render list. Currently, I am not doing that since I am just testing but later on this will be mandatory. I'm also implementing a cache for it once I get it working to reduce lag.
That's everything. Thanks for any help!
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.