Fix Indigo UV rotation ()

* Fix Indigo UV rotation

* Update MutableQuadView bakeFlags javadocs
This commit is contained in:
qolq 2022-01-14 15:20:28 +00:00 committed by GitHub
parent 0a73a6c22b
commit b0b66fc386
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions
fabric-renderer-api-v1/src/main/java/net/fabricmc/fabric/api/renderer/v1/mesh
fabric-renderer-indigo/src/main/java/net/fabricmc/fabric/impl/client/indigo/renderer/helper

View file

@ -45,7 +45,7 @@ public interface MutableQuadView extends QuadView {
int BAKE_ROTATE_NONE = 0;
/**
* Causes texture to appear rotated 90 deg. relative to nominal face.
* Causes texture to appear rotated 90 deg. clockwise relative to nominal face.
* Pass in bakeFlags parameter to {@link #spriteBake(int, Sprite, int)}.
*/
int BAKE_ROTATE_90 = 1;
@ -57,7 +57,7 @@ public interface MutableQuadView extends QuadView {
int BAKE_ROTATE_180 = 2;
/**
* Causes texture to appear rotated 270 deg. relative to nominal face.
* Causes texture to appear rotated 270 deg. clockwise relative to nominal face.
* Pass in bakeFlags parameter to {@link #spriteBake(int, Sprite, int)}.
*/
int BAKE_ROTATE_270 = 3;

View file

@ -91,7 +91,9 @@ public class TextureHelper {
}
}
private static final VertexModifier[] ROTATIONS = new VertexModifier[] { null, (q, i, t) -> q.sprite(i, t, q.spriteV(i, t), q.spriteU(i, t)), //90
private static final VertexModifier[] ROTATIONS = new VertexModifier[] {
null,
(q, i, t) -> q.sprite(i, t, q.spriteV(i, t), 1 - q.spriteU(i, t)), //90
(q, i, t) -> q.sprite(i, t, 1 - q.spriteU(i, t), 1 - q.spriteV(i, t)), //180
(q, i, t) -> q.sprite(i, t, 1 - q.spriteV(i, t), q.spriteU(i, t)) // 270
};