Skip to content

Commit

Permalink
fix: per-part lighting
Browse files Browse the repository at this point in the history
  • Loading branch information
HamaIndustries committed Nov 25, 2024
1 parent 6b6cb2e commit 9a356a1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ org.gradle.configuration-cache=true
mod.id=armistice
mod.name=Armistice
mod.license=Mozilla Public License 2.0
mod.version=1.0.0-SNAPSHOT18
mod.version=1.0.0-SNAPSHOT19
mod.group=symbolics.division.armistice
mod.authors=hama, CallMeEcho, WorldWidePixel, Nulb, Trudle, VirtuaLilith, DivineInversion, lgmrszd, Superkat32
mod.description=Machines from tomorrow, bringing peace to today
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,25 @@ public void render(MechaEntity mecha, PoseStack matrices, MultiBufferSource buff
matrices.mulPose(new Quaternionf().rotateZYX(0, yaw, calcPitch + Mth.PI));
matrices.translate(-seg.x, -seg.y, -seg.z);

BlockPos baseBlockPos = BlockPos.containing(IKUtil.f2m(base));
int light = LightTexture.pack(
mecha.level().getBrightness(
LightLayer.BLOCK,
baseBlockPos
),
mecha.level().getBrightness(
LightLayer.SKY,
baseBlockPos
)
);

PartRenderer.renderQuads(
quadArrays.get(i),
ResourceLocation.fromNamespaceAndPath(skin.id().getNamespace(), "textures/mecha/skin/" + skin.id().getPath() + ".png"),
matrices.last(),
bufferSource,
color,
packedLight,
light,
packedOverlay
);
}
Expand Down

0 comments on commit 9a356a1

Please sign in to comment.