Use shader include for fore/background shaders

The two shaders use a lot of common logic for co-ordinate and attribute
look up, so it makes sense to use a common include shader for both.

Adds support for the inverse and blink attributes to the foreground shader.
This commit is contained in:
Leroy Hopson 2024-02-07 21:37:50 +13:00
parent a849423096
commit 8b320622f9
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA
5 changed files with 95 additions and 49 deletions

View file

@ -1,7 +1,5 @@
// SPDX-FileCopyrightText: 2024 Leroy Hopson <godot-xterm@leroy.nix.nz>
// SPDX-License-Identifier: MIT
shader_type canvas_item;
void fragment() {
COLOR = texture(TEXTURE, UV);
// TODO: Check blink attribute and hide/show using the below.
//COLOR = vec4(0);
}
#define FOREGROUND
#include "./common.gdshaderinc"