opengl: Add tiling for multi-textures.

This commit is contained in:
Rod Kay
2025-09-24 12:14:44 +10:00
parent 9469acaf91
commit 4dc7e235f0
20 changed files with 274 additions and 62 deletions

View File

@@ -2,6 +2,7 @@ uniform int texture_Count;
uniform sampler2D Textures [16];
uniform float Fade [16];
uniform bool texture_Applies [16];
uniform vec2 Tiling [16];
vec4
@@ -14,17 +15,17 @@ apply_Texturing (vec2 Coords)
{
if (texture_Applies [i])
{
Color.rgb += texture (Textures [i], Coords).rgb
* texture (Textures [i], Coords).a
vec2 tiled_Coords;
tiled_Coords.s = Coords.s * Tiling [i].s;
tiled_Coords.t = Coords.t * Tiling [i].t;
Color.rgb += texture (Textures [i], tiled_Coords).rgb
* texture (Textures [i], tiled_Coords).a
* (1.0 - Fade [i]);
// Color.a += texture (Textures [i], Coords).a * (1.0 - Fade [1]);
Color.a = max (Color.a,
texture (Textures [i],Coords).a * (1.0 - Fade [i]));
// Color.a = max (Color.a,
// texture (Textures [i],Coords).a);
texture (Textures [i], tiled_Coords).a * (1.0 - Fade [i]));
}
}