Initial commit
This commit is contained in:
12
shaders/chroma_key.gdshader
Normal file
12
shaders/chroma_key.gdshader
Normal file
@@ -0,0 +1,12 @@
|
||||
shader_type canvas_item;
|
||||
|
||||
uniform float threshold : hint_range(0.0, 1.0) = 0.01;
|
||||
|
||||
void fragment() {
|
||||
vec4 tex_color = texture(TEXTURE, UV);
|
||||
float brightness = max(tex_color.r, max(tex_color.g, tex_color.b));
|
||||
if (brightness < threshold) {
|
||||
discard;
|
||||
}
|
||||
COLOR = tex_color;
|
||||
}
|
||||
1
shaders/chroma_key.gdshader.uid
Normal file
1
shaders/chroma_key.gdshader.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bd8ki8xwym5nc
|
||||
16
shaders/masked_palette_swap.gdshader
Normal file
16
shaders/masked_palette_swap.gdshader
Normal file
@@ -0,0 +1,16 @@
|
||||
shader_type canvas_item;
|
||||
|
||||
uniform sampler2D flag_mask : source_color, hint_default_black;
|
||||
uniform vec4 team_color : source_color = vec4(1.0, 0.0, 0.0, 1.0); // red by default
|
||||
|
||||
void fragment() {
|
||||
vec4 base = texture(TEXTURE, UV);
|
||||
float mask = texture(flag_mask, UV).r; // 1.0 on flag pixels, 0.0 on castle
|
||||
|
||||
// Use the grey luminance as a brightness multiplier on the team color
|
||||
float brightness = base.r; // grey means R == G == B
|
||||
vec4 tinted = vec4(team_color.rgb * brightness * 2.0, base.a);
|
||||
|
||||
// Blend: castle pixels stay grey, flag pixels get tinted
|
||||
COLOR = mix(base, tinted, mask);
|
||||
}
|
||||
1
shaders/masked_palette_swap.gdshader.uid
Normal file
1
shaders/masked_palette_swap.gdshader.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dakre5usldk6r
|
||||
Reference in New Issue
Block a user