From 014bf55cd462fed2c6bcfcf7a076e54cfe7d6bb4 Mon Sep 17 00:00:00 2001 From: Lignum Date: Sun, 31 May 2020 17:23:49 +0100 Subject: [PATCH] Cherry pick several improvements from #455 - Use texture over texture2D - the latter was deprecated in GLSL 1.30. - Cache the tbo buffer - this saves an allocation when monitors update. Closes #455. While the rest of the PR has some nice changes, it performs signlificantly worse on my system. --- .../client/render/TileEntityMonitorRenderer.java | 10 +++++++++- .../assets/computercraft/shaders/monitor.frag | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/dan200/computercraft/client/render/TileEntityMonitorRenderer.java b/src/main/java/dan200/computercraft/client/render/TileEntityMonitorRenderer.java index 405a36a29..7dd003152 100644 --- a/src/main/java/dan200/computercraft/client/render/TileEntityMonitorRenderer.java +++ b/src/main/java/dan200/computercraft/client/render/TileEntityMonitorRenderer.java @@ -35,6 +35,7 @@ import static dan200.computercraft.shared.peripheral.monitor.TileMonitor.RENDER_ public class TileEntityMonitorRenderer extends TileEntitySpecialRenderer { private static final float MARGIN = (float) (TileMonitor.RENDER_MARGIN * 1.1); + private static ByteBuffer tboContents; @Override public void render( @Nonnull TileMonitor tileEntity, double posX, double posY, double posZ, float f, int i, float f2 ) @@ -162,7 +163,14 @@ public class TileEntityMonitorRenderer extends TileEntitySpecialRenderer