Files
armorpaint/paint/shaders/copy_pass.kong
T
luboslenco 3faf6b3d73 Cleanup
2025-09-01 21:31:59 +02:00

40 lines
654 B
Plaintext

#[set(everything)]
const constants: {
empty: float4;
};
#[set(everything)]
const sampler_linear: sampler;
#[set(everything)]
const tex: tex2d;
struct vert_in {
pos: float2;
}
struct vert_out {
pos: float4;
tex: float2;
}
fun copy_pass_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 copy_pass_frag(input: vert_out): float4 {
var color: float4 = sample_lod(tex, sampler_linear, input.tex, 0.0);
return color;
}
#[pipe]
struct pipe {
vertex = copy_pass_vert;
fragment = copy_pass_frag;
}