kong test

This commit is contained in:
luboslenco
2025-03-31 18:31:49 +02:00
parent 6d4cfc9231
commit d219e04d25
49 changed files with 892 additions and 679 deletions
@@ -1,13 +0,0 @@
#version 450
uniform sampler2D tex0;
uniform sampler2D texa;
in vec2 tex_coord;
out vec4 frag_color;
void main() {
vec4 col = textureLod(tex0, tex_coord, 0.0);
float mask = clamp(textureLod(texa, tex_coord, 0.0).r + 0.5, 0.0, 1.0);
frag_color = col * mask;
}
+41
View File
@@ -0,0 +1,41 @@
#[set(everything)]
const tex0: tex2d;
#[set(everything)]
const tex0_sampler: sampler;
#[set(everything)]
const texa: tex2d;
#[set(everything)]
const texa_sampler: sampler;
struct vert_in {
pos: float2;
}
struct vert_out {
pos: float4;
tex: float2;
}
fun inpaint_preview_vert(input: vert_in): vert_out {
var output: vert_out;
output.tex = input.pos.xy * 0.5 + 0.5;
output.tex.y = 1.0 - output.tex.y;
output.pos = float4(input.pos.xy, 0.0, 1.0);
return output;
}
fun inpaint_preview_frag(input: vert_out): float4 {
var col: float4 = sample_lod(tex0, tex0_sampler, input.tex, 0.0);
var mask: float = clamp(sample_lod(texa, texa_sampler, input.tex, 0.0).r + 0.5, 0.0, 1.0);
return col * mask;
}
#[pipe]
struct pipe {
vertex = inpaint_preview_vert;
fragment = inpaint_preview_frag;
}
@@ -1,10 +0,0 @@
#version 450
uniform sampler2D tex;
in vec2 tex_coord;
out vec4 frag_color;
void main() {
frag_color = textureLod(tex, tex_coord, 0.0).rrrr;
}
+33
View File
@@ -0,0 +1,33 @@
#[set(everything)]
const tex: tex2d;
#[set(everything)]
const tex_sampler: sampler;
struct vert_in {
pos: float2;
}
struct vert_out {
pos: float4;
tex: float2;
}
fun layer_copy_rrrr_vert(input: vert_in): vert_out {
var output: vert_out;
output.tex = input.pos.xy * 0.5 + 0.5;
output.tex.y = 1.0 - output.tex.y;
output.pos = float4(input.pos.xy, 0.0, 1.0);
return output;
}
fun layer_copy_rrrr_frag(input: vert_out): float4 {
return sample_lod(tex, tex_sampler, input.tex, 0.0).rrrr;
}
#[pipe]
struct pipe {
vertex = layer_copy_rrrr_vert;
fragment = layer_copy_rrrr_frag;
}