Skip to content

Commit

Permalink
Revert "render patterns via textures to boost fps"
Browse files Browse the repository at this point in the history
This reverts commit f5a76ed.

This change will still be implemented, but we ported it to 1.20 on the
`1.20` branch, and reverting this commit is the easiest way to merge it.
  • Loading branch information
object-Object committed Dec 24, 2023
1 parent dd98b24 commit 1e9a108
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 401 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package at.petrak.hexcasting.client.entity;

import at.petrak.hexcasting.client.render.PatternTextureManager;
import at.petrak.hexcasting.client.render.RenderLib;
import at.petrak.hexcasting.common.entities.EntityWallScroll;
import com.mojang.blaze3d.systems.RenderSystem;
Expand Down Expand Up @@ -98,16 +97,12 @@ public void render(EntityWallScroll wallScroll, float yaw, float partialTicks, P
vertex(mat, norm, light, verts, dx, dy, dz, 1, 1 - margin, 0, 1, 0);

ps.popPose();

if (PatternTextureManager.useTextures && wallScroll.points != null)
PatternTextureManager.renderPatternForScroll(wallScroll.points.pointsKey, ps, bufSource, light, wallScroll.points.zappyPoints, wallScroll.blockSize, wallScroll.getShowsStrokeOrder());
}


//TODO: remove old rendering if not needed anymore for comparison
if(!PatternTextureManager.useTextures && wallScroll.points != null) {
var points = wallScroll.points.zappyPoints;
if (wallScroll.zappyPoints != null) {
var points = wallScroll.zappyPoints;
ps.pushPose();

ps.mulPose(Vector3f.YP.rotationDegrees(180f));
ps.translate(0, 0, 1.1f / 16f);
// make smaller scrolls not be charlie kirk-sized
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package at.petrak.hexcasting.client.render.be;

import at.petrak.hexcasting.api.casting.math.HexPattern;
import at.petrak.hexcasting.client.render.PatternTextureManager;
import at.petrak.hexcasting.client.render.RenderLib;
import at.petrak.hexcasting.common.blocks.akashic.BlockAkashicBookshelf;
import at.petrak.hexcasting.common.blocks.akashic.BlockEntityAkashicBookshelf;
Expand All @@ -17,7 +16,6 @@
import net.minecraft.world.phys.Vec2;

public class BlockEntityAkashicBookshelfRenderer implements BlockEntityRenderer<BlockEntityAkashicBookshelf> {

public BlockEntityAkashicBookshelfRenderer(BlockEntityRendererProvider.Context ctx) {
// NO-OP
}
Expand All @@ -31,12 +29,7 @@ public void render(BlockEntityAkashicBookshelf tile, float pPartialTick, PoseSta
}

var bs = tile.getBlockState();
if(PatternTextureManager.useTextures) {
PatternTextureManager.renderPatternForAkashicBookshelf(tile, pattern, ps, buffer, light, bs);
return;
}

//TODO: remove old rendering if not needed anymore for comparison
var oldShader = RenderSystem.getShader();
RenderSystem.setShader(GameRenderer::getPositionColorShader);
RenderSystem.enableDepthTest();
Expand Down
Loading

0 comments on commit 1e9a108

Please sign in to comment.