aboutsummaryrefslogtreecommitdiff
path: root/game/src/Game/Model/unit_colours.gdshader
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-07-11 20:33:49 +0200
committer GitHub <noreply@github.com>2024-07-11 20:33:49 +0200
commit114394f4d1bcf5249089b6e3632d259a195ec584 (patch)
tree8e82ee10733a1f41cbf44063cd12d9bdc9bc7f63 /game/src/Game/Model/unit_colours.gdshader
parentd1ff26c46dbba3e373f5c71f7ed093b5cd9ca6a0 (diff)
parent1496de8262b104ad7dd52b9f6e936fcd6ed1d384 (diff)
Merge pull request #237 from OpenVicProject/scrolling-textures
Scrolling model materials (tank tracks and smoke)
Diffstat (limited to 'game/src/Game/Model/unit_colours.gdshader')
-rw-r--r--game/src/Game/Model/unit_colours.gdshader10
1 files changed, 5 insertions, 5 deletions
diff --git a/game/src/Game/Model/unit_colours.gdshader b/game/src/Game/Model/unit_colours.gdshader
index dd0f5e2..2ffc771 100644
--- a/game/src/Game/Model/unit_colours.gdshader
+++ b/game/src/Game/Model/unit_colours.gdshader
@@ -1,11 +1,11 @@
shader_type spatial;
-render_mode blend_mix, depth_draw_opaque, cull_disabled, diffuse_burley, specular_schlick_ggx;
+render_mode cull_disabled;
//hold all the textures for the units that need this shader to mix in their
//nation colours (mostly generic infantry units)
-uniform sampler2D texture_albedo[32] : source_color, filter_linear_mipmap, repeat_enable;
+uniform sampler2D texture_diffuse[32] : source_color, filter_linear_mipmap, repeat_enable;
uniform sampler2D texture_nation_colors_mask[32] : source_color, filter_linear_mipmap, repeat_enable;
instance uniform vec3 colour_primary : source_color;
@@ -14,12 +14,12 @@ instance uniform vec3 colour_tertiary : source_color;
//used to access the right textures since different units (with different textures)
//will use this same shader
-instance uniform uint tex_index_specular;
instance uniform uint tex_index_diffuse;
+instance uniform uint tex_index_specular;
void fragment() {
vec2 base_uv = UV;
- vec4 albedo_tex = texture(texture_albedo[tex_index_diffuse], base_uv);
+ vec4 diffuse_tex = texture(texture_diffuse[tex_index_diffuse], base_uv);
vec4 nation_colours_tex = texture(texture_nation_colors_mask[tex_index_specular], base_uv);
//set colours to either be white (1,1,1) or the nation colour based on the mask
@@ -27,5 +27,5 @@ void fragment() {
vec3 secondary_col = mix(vec3(1.0, 1.0, 1.0), colour_secondary, nation_colours_tex.b);
vec3 tertiary_col = mix(vec3(1.0, 1.0, 1.0), colour_tertiary, nation_colours_tex.r);
- ALBEDO = albedo_tex.rgb * primary_col * secondary_col * tertiary_col;
+ ALBEDO = diffuse_tex.rgb * primary_col * secondary_col * tertiary_col;
}