Skip to content

Commit

Permalink
Invert shadow decal
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackYps committed Dec 5, 2023
1 parent 44d5257 commit b43e25a
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,10 @@ public static byte[] compressShadow(FloatMask mask, LightingSettings lightingSet
for (int y = 0; y < size; y++) {
for (int x = 0; x < size; x++) {
float value = mask.get(x, y);
int r = (byte) StrictMath.min(StrictMath.max(value * shadowFillColor.getX() * 128, 0), 255);
int g = (byte) StrictMath.min(StrictMath.max(value * shadowFillColor.getY() * 128, 0), 255);
int b = (byte) StrictMath.min(StrictMath.max(value * shadowFillColor.getZ() * 128, 0), 255);
int a = (byte) StrictMath.min(StrictMath.max(value * opacityScale * 255, 0), 255);
int r = (byte) StrictMath.min(StrictMath.max(shadowFillColor.getX() * 128, 0), 255);
int g = (byte) StrictMath.min(StrictMath.max(shadowFillColor.getY() * 128, 0), 255);
int b = (byte) StrictMath.min(StrictMath.max(shadowFillColor.getZ() * 128, 0), 255);
int a = (byte) StrictMath.min(StrictMath.max((1 - value) * opacityScale * 255, 0), 255);
imageByteBuffer.put((byte) r);
imageByteBuffer.put((byte) g);
imageByteBuffer.put((byte) b);
Expand Down

0 comments on commit b43e25a

Please sign in to comment.