Jump to content

Recommended Posts

Posted (edited)

I am using minecraft 1.20 and using a mixin in EntityRenderer renderLabelIfPresent.

I tried rendering the image like this:

```

 

float minX = h - (float) textRenderer.fontHeight - 2f; float maxX = h - 1f; float minY = i - 1f; float maxY = i + textRenderer.fontHeight; float minU = 0; float maxU = 128; float minV = 0; float maxV = 128;

 

VertexConsumer vertexConsumer2 = vertexConsumers.getBuffer(RenderLayer.getText(texture));
vertexConsumer2.vertex(matrix4f, minX, maxY, 0f).color(1f, 1f, 1f, 1f).texture(minU, minV).light(light).next();
vertexConsumer2.vertex(matrix4f, maxX, maxY, 0f).color(1f, 1f, 1f, 1f).texture(maxU, minV).light(light).next();
vertexConsumer2.vertex(matrix4f, maxX, minY, 0f).color(1f, 1f, 1f, 1f).texture(maxU, maxV).light(light).next();
vertexConsumer2.vertex(matrix4f, minX, minY, 0f).color(1f, 1f, 1f, 1f).texture(minU, maxV).light(light).next();

```
It kinda works. The problem is that the headpitch affects the zoom and every movement of the player shifts the image. This results in the image rendered multiple times in a grid and them constantly moving. I want that the image is rendered once at full size (minX, minY) -> (maxX, maxY)

 

The problem is that i get the position matrix like this: matrices.peek().getPositionMatrix();

I need the position of the player to render it. I created a duplicate matrix and replaced it with 0. There are 4 floats that are relevant for it to render.
new Matrix4f(matrix4f.m00(), 0, 0, 0, 0, matrix4f.m11(), 0, 0, 0, 0, 0, 0, 0, matrix4f.m31(), matrix4f.m32(), 0);
m31 controls the height where it is rendered. This does not fix anything. The question is how to i need to change m00, m11, m32 to render at the right pos and fix the weird effect

 

Edited by JustAUser

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.