1
0
Fork 0

experimental new rendering

This commit is contained in:
Sen 2025-08-30 21:00:34 +02:00
parent d4c7c5bbea
commit 2006e31a71
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
96 changed files with 1658 additions and 3104 deletions

View file

@ -1,6 +1,6 @@
package client.renderer.tileentity;
import org.lwjgl.opengl.GL46;
import org.lwjgl.opengl.GL46C;
import client.renderer.Drawing;
import client.renderer.GlState;
@ -14,13 +14,13 @@ public class SignRenderer extends ElementRenderer<TileEntitySign>
{
public void renderElements(TileEntitySign te, double x, double y, double z, float partialTicks)
{
GL46.glPushMatrix();
GL46C.glPushMatrix();
float f = 0.6666667F;
State state = te.getState();
if (state.getBlock() instanceof BlockStandingSign)
{
GL46.glTranslatef((float)x + 0.5F, (float)y + 0.75F * f, (float)z + 0.5F);
GL46C.glTranslatef((float)x + 0.5F, (float)y + 0.75F * f, (float)z + 0.5F);
int r = state.getValue(BlockStandingSign.FACING).getIndex();
float f1 = 0.0F;
@ -38,8 +38,8 @@ public class SignRenderer extends ElementRenderer<TileEntitySign>
{
f1 = -90.0F;
}
GL46.glRotatef(-f1, 0.0F, 1.0F, 0.0F);
GL46.glTranslatef(0.0F, f * -0.0625f * 2.0f, 0.0F);
GL46C.glRotatef(-f1, 0.0F, 1.0F, 0.0F);
GL46C.glTranslatef(0.0F, f * -0.0625f * 2.0f, 0.0F);
}
else
{
@ -61,16 +61,16 @@ public class SignRenderer extends ElementRenderer<TileEntitySign>
f2 = -90.0F;
}
GL46.glTranslatef((float)x + 0.5F, (float)y + 0.75F * f, (float)z + 0.5F);
GL46.glRotatef(-f2, 0.0F, 1.0F, 0.0F);
GL46.glTranslatef(0.0F, -0.3125F - f * 0.0625f * 0.5f, -0.4375F);
GL46C.glTranslatef((float)x + 0.5F, (float)y + 0.75F * f, (float)z + 0.5F);
GL46C.glRotatef(-f2, 0.0F, 1.0F, 0.0F);
GL46C.glTranslatef(0.0F, -0.3125F - f * 0.0625f * 0.5f, -0.4375F);
}
GlState.enableRescaleNormal();
float f3 = 0.015625F * f;
GL46.glTranslatef(0.0F, 0.5F * f, 0.1F * f);
GL46.glScalef(f3, -f3, f3);
GL46.glNormal3f(0.0F, 0.0F, -1.0F * f3);
GL46C.glTranslatef(0.0F, 0.5F * f, 0.1F * f);
GL46C.glScalef(f3, -f3, f3);
GL46C.glNormal3f(0.0F, 0.0F, -1.0F * f3);
GlState.depthMask(false);
for (int j = 0; j < te.text.length; ++j)
@ -78,15 +78,15 @@ public class SignRenderer extends ElementRenderer<TileEntitySign>
if (te.text[j] != null && !te.text[j].isEmpty())
{
String s = te.text[j].length() > 50 ? te.text[j].substring(0, 50) : te.text[j];
GL46.glPushMatrix();
GL46.glScalef(0.75f, 0.75f, 0.75f);
Drawing.drawTextCenteredN(s, 0, j * (18 - 3) - 30, 0xff000000);
GL46.glPopMatrix();
GL46C.glPushMatrix();
GL46C.glScalef(0.75f, 0.75f, 0.75f);
Drawing.drawTextCentered3d(s, 0, j * (18 - 3) - 30, 0xff000000);
GL46C.glPopMatrix();
}
}
GlState.depthMask(true);
GlState.color(1.0F, 1.0F, 1.0F, 1.0F);
GL46.glPopMatrix();
GL46C.glPopMatrix();
}
}