Shader working.

This commit is contained in:
2025-02-25 11:20:05 -06:00
parent 1f83690334
commit 4ff3cf6c5c
15 changed files with 154 additions and 78 deletions

View File

@@ -1,18 +1,11 @@
#include "entity.glsl"
#include "../fragments/header.glsl"
// Inputs from vertex shader
in vec2 v_TextureCoord;
flat in int v_Entity;
// Frag pixel color
out vec4 FragColor;
void main() {
Entity e = entities[v_Entity];
vec4 textureColor = tilesetGetColor(e.tileset, v_TextureCoord);
// We remove the pink color as transparent
if(textureColor.r == 1.0 && textureColor.g == 0.0 && textureColor.b == 1.0) {
discard;
}
FragColor = textureColor;
FragColor = vec4(1, 1, 1, 1);
}