Combat base added
This commit is contained in:
@@ -2,9 +2,18 @@ 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
|
||||
uniform float chroma_threshold : hint_range(0.0, 1.0) = 0.01;
|
||||
|
||||
void fragment() {
|
||||
vec4 base = texture(TEXTURE, UV);
|
||||
vec4 base = texture(TEXTURE, UV);
|
||||
|
||||
// --- Chroma key: discard near-black pixels ---
|
||||
float max_channel = max(base.r, max(base.g, base.b));
|
||||
if (max_channel < chroma_threshold) {
|
||||
discard;
|
||||
}
|
||||
|
||||
// --- Palette swap using masks ---
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user