-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
87 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...in/java/com/lowdragmc/shimmer/forge/core/mixins/rubidium/VanillaLikeChunkVertexMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.lowdragmc.shimmer.forge.core.mixins.rubidium; | ||
|
||
import me.jellysquid.mods.sodium.client.render.chunk.terrain.material.Material; | ||
import me.jellysquid.mods.sodium.client.render.chunk.vertex.format.ChunkVertexEncoder; | ||
import me.jellysquid.mods.sodium.client.render.chunk.vertex.format.impl.VanillaLikeChunkVertex; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Mixin(value = VanillaLikeChunkVertex.class, remap = false) | ||
public abstract class VanillaLikeChunkVertexMixin { | ||
@Shadow | ||
private static int encodeDrawParameters(Material par1, int par2) { | ||
throw new RuntimeException(); | ||
} | ||
|
||
@Shadow | ||
private static int encodeLight(int light) { | ||
throw new RuntimeException(); | ||
} | ||
|
||
@Redirect(method = "lambda$getEncoder$0", at = @At(value = "INVOKE", target = "Lme/jellysquid/mods/sodium/client/render/chunk/vertex/format/impl/VanillaLikeChunkVertex;encodeDrawParameters(Lme/jellysquid/mods/sodium/client/render/chunk/terrain/material/Material;I)I")) | ||
private static int injectMaterialForBloom(Material material, int i, long ptr, Material material1, ChunkVertexEncoder.Vertex vertex, int sectionIndex) { | ||
var origin = encodeDrawParameters(material,i); | ||
if ((vertex.light & 0x100) != 0) { | ||
origin |= (0x01 << 4); | ||
} | ||
return origin; | ||
} | ||
|
||
@Redirect(method = "lambda$getEncoder$0", at = @At(value = "INVOKE", target = "Lme/jellysquid/mods/sodium/client/render/chunk/vertex/format/impl/VanillaLikeChunkVertex;encodeLight(I)I")) | ||
private static int injectLightForBloom(int light, long ptr, Material material1, ChunkVertexEncoder.Vertex vertex, int sectionIndex) { | ||
if ((light & 0x100) != 0) { | ||
return 15 | 15 << 4; | ||
} | ||
return encodeLight(light); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters