Render no border without wonky GL settings.

This commit is contained in:
Florian Nücke
2022-01-25 17:42:48 +01:00
parent 8f89d318d4
commit a1a1f3e887
2 changed files with 4 additions and 6 deletions

View File

@@ -115,8 +115,6 @@ public abstract class ModRenderType extends RenderType {
public DynamicTextureStateShard(final DynamicTexture texture) {
super(() -> {
RenderSystem.enableTexture();
RenderSystem.texParameter(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL13.GL_CLAMP_TO_BORDER);
RenderSystem.texParameter(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL13.GL_CLAMP_TO_BORDER);
// TODO client side setting
// texture.setFilter(true, false);
RenderSystem.setShaderTexture(0, texture.getId());

View File

@@ -130,10 +130,10 @@ public final class ProjectorRenderer implements BlockEntityRenderer<ProjectorBlo
final int x = index % discreteWidth;
final int y = index / discreteWidth;
final float u0 = x / width - vOffset;
final float u1 = (x + 1) / width - vOffset;
final float v0 = y / height - uOffset;
final float v1 = (y + 1) / height - uOffset;
final float u0 = Math.max(0, x / width - vOffset);
final float u1 = Math.min(1, (x + 1) / width - vOffset);
final float v0 = Math.max(0, y / height - uOffset);
final float v1 = Math.min(1, (y + 1) / height - uOffset);
consumer.vertex(matrix, u0, v0, 0).uv(1 - u0, 1 - v0).endVertex();
consumer.vertex(matrix, u1, v0, 0).uv(1 - u1, 1 - v0).endVertex();