Skip to content

Commit

Permalink
Add missing normal vector copy
Browse files Browse the repository at this point in the history
  • Loading branch information
xCollateral committed Oct 13, 2024
1 parent 0ef9f9a commit ca9cf7b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,8 @@ public static int packedNormalFromDirection(Direction direction) {

return I32_SNorm.packNormal(normal.getX(), normal.getY(), normal.getZ());
}

public static void unpackNormalTo(int packedNormal, Vector3f normal) {
normal.set(I32_SNorm.unpackX(packedNormal), I32_SNorm.unpackY(packedNormal), I32_SNorm.unpackZ(packedNormal));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ public final MutableQuadViewImpl fromVanilla(BakedQuad quad, RenderMaterial mate
ModelQuadView quadView = (ModelQuadView) quad;
int normal = quadView.getNormal();
data[baseIndex + HEADER_FACE_NORMAL] = normal;
NormalHelper.unpackNormalTo(normal, faceNormal);

Direction lightFace = quadView.lightFace();
data[baseIndex + HEADER_BITS] = EncodingFormat.lightFace(data[baseIndex + HEADER_BITS], lightFace);
Expand Down

0 comments on commit ca9cf7b

Please sign in to comment.