About to start shaders
This commit is contained in:
18
src/duskgl/display/shader/entityshader/entity_frag.glsl
Normal file
18
src/duskgl/display/shader/entityshader/entity_frag.glsl
Normal file
@@ -0,0 +1,18 @@
|
||||
#include "entity.glsl"
|
||||
|
||||
in vec2 v_TextureCoord;
|
||||
flat in int v_Entity;
|
||||
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user