Skip to content

Commit

Permalink
fix: improve render scaling of Flesh Blob models
Browse files Browse the repository at this point in the history
  • Loading branch information
Elenterius committed Aug 23, 2024
1 parent 45e3ed1 commit 46e6df6
Showing 1 changed file with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,9 @@ protected AbstractFleshBlobRenderer(EntityRendererProvider.Context context, GeoM
shadowRadius = 0.65f;
}

@Override
public GeoEntityRenderer<T> withScale(float scale) {
shadowRadius = 0.65f * scale;
return withScale(scale, scale);
}

@Override
public void preRender(PoseStack poseStack, T fleshBlob, BakedGeoModel model, MultiBufferSource bufferSource, VertexConsumer buffer, boolean isReRender, float partialTick, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) {

withScale(fleshBlob.getBlobScale());
shadowRadius = 0.65f * fleshBlob.getBlobScale();

AnimationProcessor<?> animationProcessor = getGeoModel().getAnimationProcessor();

Expand All @@ -42,11 +35,11 @@ public void preRender(PoseStack poseStack, T fleshBlob, BakedGeoModel model, Mul
}

@Override
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, T animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
if (!isReRender && (widthScale != 1 || heightScale != 1)) {
poseStack.scale(0.999f, 0.999f, 0.999f);
poseStack.translate(0, 0.001f, 0);
poseStack.scale(widthScale, heightScale, widthScale);
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, T fleshBlob, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
float blobScale = fleshBlob.getBlobScale();

if (!isReRender && blobScale != 1) {
poseStack.scale(blobScale, blobScale, blobScale);
}
}

Expand Down

0 comments on commit 46e6df6

Please sign in to comment.