mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-05-03 20:14:22 +02:00
Add support for two different inverse modes
- Inverse mode invert (default) will invert the color in shader. - Inverse mode swap will simply swap the foreground and background colors. This is the default behavior of libtsm and GodotXterm v3.
This commit is contained in:
parent
930f3ef352
commit
8c30bec861
3 changed files with 41 additions and 1 deletions
|
@ -13,6 +13,7 @@ uniform vec2 cell_size;
|
|||
uniform vec2 grid_size;
|
||||
|
||||
uniform sampler2D attributes;
|
||||
uniform bool inverse_enabled = true;
|
||||
|
||||
#ifdef BACKGROUND
|
||||
uniform vec4 background_color;
|
||||
|
@ -46,7 +47,7 @@ void fragment() {
|
|||
color = texture(TEXTURE, UV);
|
||||
#endif
|
||||
|
||||
if (has_attribute(sample_uv, FLAG_INVERSE)) {
|
||||
if (has_attribute(sample_uv, FLAG_INVERSE) && inverse_enabled) {
|
||||
color = vec4(1.0 - color.rgb, color.a);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue