Skip to content

Commit

Permalink
fix: Image Morph extrusion rendering broken
Browse files Browse the repository at this point in the history
  • Loading branch information
Chryfi committed Jul 1, 2024
1 parent 3c47ac0 commit b60eef4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/java/mchorse/blockbuster_pack/morphs/ImageMorph.java
Original file line number Diff line number Diff line change
Expand Up @@ -404,13 +404,13 @@ private void renderPicture(float scale, int ticks, float partialTicks)
GlStateManager.matrixMode(GL11.GL_MODELVIEW);
}

buffer.begin(GL11.GL_QUADS, VertexBuilder.getFormat(true, true, false, true));
if (!this.thickness) {
buffer.begin(GL11.GL_QUADS, VertexBuilder.getFormat(true, true, false, true));

Color color = this.image.color;
Color color = this.image.color;

/* By default the pos is (0.5, -0.5, -0.5, 0.5) */
/* By default the pos is (0.5, -0.5, -0.5, 0.5) */

if (!this.thickness) {
/* Frontface */
buffer.pos(pos.x, pos.z, 0.0F).color(color.r, color.g, color.b, color.a).tex(uv.x, uv.z).normal(0.0F, 0.0F, 1.0F).endVertex();
buffer.pos(pos.x, pos.w, 0.0F).color(color.r, color.g, color.b, color.a).tex(uv.x, uv.w).normal(0.0F, 0.0F, 1.0F).endVertex();
Expand All @@ -422,6 +422,8 @@ private void renderPicture(float scale, int ticks, float partialTicks)
buffer.pos(pos.y, pos.z, 0.0F).color(color.r, color.g, color.b, color.a).tex(uv.y, uv.z).normal(0.0F, 0.0F, -1.0F).endVertex();
buffer.pos(pos.y, pos.w, 0.0F).color(color.r, color.g, color.b, color.a).tex(uv.y, uv.w).normal(0.0F, 0.0F, -1.0F).endVertex();
buffer.pos(pos.x, pos.w, 0.0F).color(color.r, color.g, color.b, color.a).tex(uv.x, uv.w).normal(0.0F, 0.0F, -1.0F).endVertex();

tessellator.draw();
}
else
{
Expand All @@ -434,8 +436,6 @@ private void renderPicture(float scale, int ticks, float partialTicks)
}
}

tessellator.draw();

if (textureMatrix)
{
GlStateManager.matrixMode(GL11.GL_TEXTURE);
Expand Down

0 comments on commit b60eef4

Please sign in to comment.