From 076337d8f6310e8feaaa4b815b65887ba0e7c29b Mon Sep 17 00:00:00 2001 From: Danielxs01 Date: Wed, 17 Apr 2024 21:38:32 +0200 Subject: [PATCH] [#157] Replaced antivignette.png with light.png and scale image to OBJ-Object --- .../landofsignals/utils/FlareUtils.java | 23 +++--------------- .../landofsignals/textures/light/light.png | Bin 0 -> 1284 bytes 2 files changed, 4 insertions(+), 19 deletions(-) create mode 100644 src/main/resources/assets/landofsignals/textures/light/light.png diff --git a/src/main/java/net/landofrails/landofsignals/utils/FlareUtils.java b/src/main/java/net/landofrails/landofsignals/utils/FlareUtils.java index ae5f13cd..fd7246d8 100644 --- a/src/main/java/net/landofrails/landofsignals/utils/FlareUtils.java +++ b/src/main/java/net/landofrails/landofsignals/utils/FlareUtils.java @@ -27,7 +27,7 @@ public class FlareUtils { - private static final Identifier LIGHT_TEX = new Identifier(LandOfSignals.MODID, "textures/light/antivignette.png"); + private static final Identifier LIGHT_TEX = new Identifier(LandOfSignals.MODID, "textures/light/light.png"); private static final Map>> signalpartFlareCache = new HashMap<>(); private static final Map> signFlareCache = new HashMap<>(); @@ -165,7 +165,8 @@ public static void renderFlares(Flare[] flares, Vec3i pos, int blockRotate, Vec3 int viewAngle = 45; float intensity = 1 - Math.abs(Math.max(-viewAngle, Math.min(viewAngle, VecUtil.toWrongYaw(playerOffset) - 90))) / viewAngle; intensity *= (float) Math.abs(playerOffset.x/50); - intensity = Math.min(intensity, 1.5f); + intensity *= 0.5f; + intensity = Math.min(intensity, 0.25f); // @@ -232,23 +233,7 @@ private static void cacheFlare(Flare flare, String flareId, OBJModel model, Stri double maxX = flareGroupsOBJGroups.stream().mapToDouble(g -> g.max.x).max().getAsDouble(); double minX = flareGroupsOBJGroups.stream().mapToDouble(g -> g.min.x).min().getAsDouble(); - double lampScale = Math.max((maxZ - minZ) * modelScaling[2], (maxX - minX) * modelScaling[0]); - - /* - - float flareOffset = flare.getOffset(); - Set groups = flare.getObjGroups() != null && flare.getObjGroups().length > 0 - ? Arrays.stream(flare.getObjGroups()).collect(Collectors.toSet()) - : model.groups(); - Vec3d centerOfModel = model.centerOfGroups(groups); - Vec3d centerOfLightFlare = model.centerOfGroups(flareGroups.keySet()); - Vec3d modelOffset = centerOfLightFlare.subtract(centerOfModel); - modelOffset = new Vec3d(modelOffset.x, modelOffset.y, -modelOffset.z - flareOffset); - float yCorrection = 0.5f; - Vec3d flareCenterOffset = new Vec3d(modelTranslation[0], modelTranslation[1] + yCorrection, modelTranslation[2]); - Vec3d combinedOffset = flareCenterOffset.add(modelOffset); - - */ + double lampScale = Math.max((maxZ - minZ) * modelScaling[2], (maxX - minX) * modelScaling[0]) * 0.65d; // Scaling for the flare from the block in the contentpack Vec3d scaling = new Vec3d(modelScaling[0], modelScaling[1], modelScaling[2]); diff --git a/src/main/resources/assets/landofsignals/textures/light/light.png b/src/main/resources/assets/landofsignals/textures/light/light.png new file mode 100644 index 0000000000000000000000000000000000000000..850538bf06f74105bc27685b2315c9ff51825060 GIT binary patch literal 1284 zcmV+f1^fDmP)EX>4Tx04R}tkv&MmKp2MKrb>&n2--o!AwzYtAS&XhRVYG*P%E_RU~=gnG%+M8 zE{=k0!NH%!s)LKOt`4q(Aov5~=H{g6A|-y86k5c1$8itueecWNcYx5SGR^8512o+> zGpVGQ%dd!`SA=OsA)rrYmN6?yY50z>dj$A?m*83cb$^biTCf-p5Q%4)VcNvaEL z!FiuJ#>%ovd`>)S(glehxvqHp#<}FOz%yfJHZw;YBNj^?taLCdn;P*Xaa`4O$`^7T ztDLtuYtq2l^-JVZ$W;L& z$2>NmL3aJ%fAG7vR&iq7ONu0c?ia`T7zRSSK(p>R-^Y&AJOP5wz?I(iZ#01EPtxmc zEq(;_ZUYzBZB5w&E_Z-|Cqp)6R|?V+ibdf4jJ_!k^xpzKt6tw)=Qw=;vec{e4RCM> zjFc#Q&F9_W&c6Ly)9T+3=PYt>Ki=7u00006VoOIv0RI600RN!9r;`8x010qNS#tmY zE+YT{E+YYWr9XB6000McNliru

B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