Pixelated

This commit is contained in:
2025-05-08 21:49:21 -05:00
parent f079f43664
commit 703f70bcf0
11 changed files with 245 additions and 11 deletions

View File

@@ -8,6 +8,7 @@ uniform int direction;
const int FRAMES = 1;
const int DIRECTIONS = 4;
const float PIXEL_UNIT = 1.0 / 32.0; // Define pixel-perfect unit
void vertex() {
vec2 tileSize = vec2(1.0 / float(DIRECTIONS), 1.0 / float(FRAMES));
@@ -26,6 +27,9 @@ void vertex() {
} else if(VERTEX_ID == 0) {
UV = bottomRight;
}
// Round UV to the nearest pixel-perfect unit
UV = floor(UV / PIXEL_UNIT + 0.5) * PIXEL_UNIT;
}
void fragment() {