From e1ddd7c2fcf5cb63e9ddf05214308036e5c3c7b0 Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Mon, 2 Dec 2024 17:19:00 -0800 Subject: [PATCH] You merely adopted it - Default light to 0 in DefaultVertexList - Take the max of mesh and instance light in the instance shader --- .../dev/engine_room/flywheel/lib/vertex/DefaultVertexList.java | 3 +-- .../resources/assets/flywheel/flywheel/instance/oriented.vert | 2 +- .../lib/resources/assets/flywheel/flywheel/instance/posed.vert | 2 +- .../assets/flywheel/flywheel/instance/transformed.vert | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/common/src/lib/java/dev/engine_room/flywheel/lib/vertex/DefaultVertexList.java b/common/src/lib/java/dev/engine_room/flywheel/lib/vertex/DefaultVertexList.java index b6361854b..9d5f9c8bf 100644 --- a/common/src/lib/java/dev/engine_room/flywheel/lib/vertex/DefaultVertexList.java +++ b/common/src/lib/java/dev/engine_room/flywheel/lib/vertex/DefaultVertexList.java @@ -1,7 +1,6 @@ package dev.engine_room.flywheel.lib.vertex; import dev.engine_room.flywheel.api.vertex.MutableVertexList; -import net.minecraft.client.renderer.LightTexture; import net.minecraft.client.renderer.texture.OverlayTexture; public interface DefaultVertexList extends MutableVertexList { @@ -57,7 +56,7 @@ public interface DefaultVertexList extends MutableVertexList { @Override default int light(int index) { - return LightTexture.FULL_BRIGHT; + return 0; } @Override diff --git a/common/src/lib/resources/assets/flywheel/flywheel/instance/oriented.vert b/common/src/lib/resources/assets/flywheel/flywheel/instance/oriented.vert index 6d113f0a8..f7cf36dc0 100644 --- a/common/src/lib/resources/assets/flywheel/flywheel/instance/oriented.vert +++ b/common/src/lib/resources/assets/flywheel/flywheel/instance/oriented.vert @@ -6,5 +6,5 @@ void flw_instanceVertex(in FlwInstance i) { flw_vertexColor *= i.color; flw_vertexOverlay = i.overlay; // Some drivers have a bug where uint over float division is invalid, so use an explicit cast. - flw_vertexLight = vec2(i.light) / 256.0; + flw_vertexLight = max(vec2(i.light) / 256.0, flw_vertexLight); } diff --git a/common/src/lib/resources/assets/flywheel/flywheel/instance/posed.vert b/common/src/lib/resources/assets/flywheel/flywheel/instance/posed.vert index 918883e84..deae24c42 100644 --- a/common/src/lib/resources/assets/flywheel/flywheel/instance/posed.vert +++ b/common/src/lib/resources/assets/flywheel/flywheel/instance/posed.vert @@ -4,5 +4,5 @@ void flw_instanceVertex(in FlwInstance i) { flw_vertexColor *= i.color; flw_vertexOverlay = i.overlay; // Some drivers have a bug where uint over float division is invalid, so use an explicit cast. - flw_vertexLight = vec2(i.light) / 256.0; + flw_vertexLight = max(vec2(i.light) / 256.0, flw_vertexLight); } diff --git a/common/src/lib/resources/assets/flywheel/flywheel/instance/transformed.vert b/common/src/lib/resources/assets/flywheel/flywheel/instance/transformed.vert index e0abf722b..73097069f 100644 --- a/common/src/lib/resources/assets/flywheel/flywheel/instance/transformed.vert +++ b/common/src/lib/resources/assets/flywheel/flywheel/instance/transformed.vert @@ -4,5 +4,5 @@ void flw_instanceVertex(in FlwInstance i) { flw_vertexColor *= i.color; flw_vertexOverlay = i.overlay; // Some drivers have a bug where uint over float division is invalid, so use an explicit cast. - flw_vertexLight = vec2(i.light) / 256.0; + flw_vertexLight = max(vec2(i.light) / 256.0, flw_vertexLight); }