Dummy NPC texture

This commit is contained in:
2025-05-05 23:12:09 -05:00
parent 2b3cfc0eb7
commit 424edaf581
6 changed files with 53 additions and 8 deletions

View File

@@ -6,12 +6,15 @@ uniform vec4 color : source_color;
uniform int frame;
uniform int direction;
const int FRAMES = 3;
const int FRAMES = 1;
const int DIRECTIONS = 4;
void vertex() {
vec2 tileSize = vec2(1.0 / float(FRAMES), 1.0 / float(DIRECTIONS));
vec2 topLeft = tileSize * vec2(float(frame % FRAMES), float(direction % DIRECTIONS));
vec2 tileSize = vec2(1.0 / float(DIRECTIONS), 1.0 / float(FRAMES));
vec2 topLeft = tileSize * vec2(
float(direction % DIRECTIONS),
float(frame % FRAMES)
);
vec2 bottomRight = topLeft + tileSize;
if(VERTEX_ID == 3) {
@@ -27,6 +30,9 @@ void vertex() {
void fragment() {
vec4 npcColor = texture(npcTexture, UV);
if(npcColor.a == 0.0)
discard;
// Remove PINK background
if(npcColor.r == 1.0 && npcColor.g == 0.0 && npcColor.b == 1.0)