You merely adopted it

- Default light to 0 in DefaultVertexList
- Take the max of mesh and instance light in the instance shader
This commit is contained in:
Jozufozu 2024-12-02 17:19:00 -08:00
parent 9e60045d43
commit e1ddd7c2fc
4 changed files with 4 additions and 5 deletions

View file

@ -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

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}