Skip to content

Commit

Permalink
You merely adopted it
Browse files Browse the repository at this point in the history
- Default light to 0 in DefaultVertexList
- Take the max of mesh and instance light in the instance shader
  • Loading branch information
Jozufozu committed Dec 3, 2024
1 parent 9e60045 commit e1ddd7c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -57,7 +56,7 @@ default int overlay(int index) {

@Override
default int light(int index) {
return LightTexture.FULL_BRIGHT;
return 0;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit e1ddd7c

Please sign in to comment.