Finally fixed font texture

This commit is contained in:
2024-05-09 14:12:40 +01:00
parent 10952b6502
commit 099340f870
20 changed files with 294 additions and 95 deletions

View File

@@ -1,14 +1,25 @@
shader_type canvas_item;
uniform sampler2D ColourTexture;
uniform vec2 rect_global_position;
uniform vec2 rect_size;
void vertex() {
// Called for every vertex the material is visible on.
}
void fragment() {
// Called for every pixel the material is visible on.
if (COLOR.rgba == vec4(1.0, 0.0, 1.0, 1.0)) {
COLOR.rgb = vec3(UV.y * 8.0, UV.y * 6.0, 1.0 - (UV.y * 14.0));
// float b = (COLOR.r + COLOR.g + COLOR.b) / 3.0;
// COLOR.rgb = texture(ColourTexture, UV).rgb * vec3(b, b, b);
if ((COLOR.r > 0.8) && (COLOR.g > 0.8) && (COLOR.b < 0.2) && (COLOR.a > 0.9)) {
vec2 actual_uv = (SCREEN_UV - rect_global_position) * rect_size;
COLOR.rgb = texture(ColourTexture, actual_uv).rgb ;
}
// if (COLOR.rgba == vec4(1.0, 0.0, 1.0, 1.0)) {
// if (COLOR.a > 0.9) {
// COLOR.rgb = texture(ColourTexture, UV).rgb;
// COLOR.rgb = vec3(UV.y * 8.0, UV.y * 6.0, 1.0 - (UV.y * 14.0));
// COLOR.rgb = vec3(UV.x, UV.x, UV.x);
// }
}
//void light() {