texcoord is wrong but silhouette is correct

This commit is contained in:
minjaesong
2024-08-20 03:58:35 +09:00
parent 02f9303767
commit e12a049e70
4 changed files with 45 additions and 54 deletions

View File

@@ -44,7 +44,7 @@ const vec2 haalf = vec2(0.5, 0.5);
out vec4 fragColor;
ivec2 getTileXY(int tileNumber) {
ivec2 tileNumberToXY(int tileNumber) {
return ivec2(tileNumber % int(tilesInAtlas.x), tileNumber / int(tilesInAtlas.x));
}
@@ -103,8 +103,8 @@ void main() {
int tile = tbf.x;
int breakage = tbf.y;
int flipRot = tbf.z;
ivec2 tileXY = getTileXY(tile);
ivec2 breakageXY = getTileXY(breakage + 5); // +5 is hard-coded constant that depends on the contents of the atlas
ivec2 tileXY = tileNumberToXY(tile);
ivec2 breakageXY = tileNumberToXY(breakage + 5); // +5 is hard-coded constant that depends on the contents of the atlas
// calculate the UV coord value for texture sampling //