-
Notifications
You must be signed in to change notification settings - Fork 809
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Overwrite TextureAtlasSprite#uvShrinkRatio (#2746)
Mods, especially on Fabric, typically don't use FaceBakery to create custom quads outside of baked models, but they may still use uvShrinkRatio to manually shrink the UVs.
- Loading branch information
1 parent
3c81fa6
commit 31d08b0
Showing
3 changed files
with
18 additions
and
19 deletions.
There are no files selected for viewing
18 changes: 0 additions & 18 deletions
18
common/src/main/java/net/caffeinemc/mods/sodium/mixin/core/model/FaceBakeryMixin.java
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
...on/src/main/java/net/caffeinemc/mods/sodium/mixin/core/model/TextureAtlasSpriteMixin.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,17 @@ | ||
package net.caffeinemc.mods.sodium.mixin.core.model; | ||
|
||
import net.minecraft.client.renderer.texture.TextureAtlasSprite; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Overwrite; | ||
|
||
@Mixin(TextureAtlasSprite.class) | ||
public class TextureAtlasSpriteMixin { | ||
@Overwrite | ||
public float uvShrinkRatio() { | ||
// Vanilla tries to apply a bias to texture coordinates to avoid texture bleeding (see FaceBakery#bakeQuad). | ||
// This is counterproductive with Sodium's terrain rendering, since the bias is applied in the shader instead. | ||
// Overwrite this method instead of adjusting its return value in FaceBakery as other mods may use it to | ||
// manually apply the bias. | ||
return 0.0f; | ||
} | ||
} |
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