aboutsummaryrefslogtreecommitdiff
path: root/src/render_helpers/shaders/resize.frag
blob: d1ed30fe3398471bb660f48b9d9b5b07304f7638 (plain)
1
2
3
4
5
6
7
8
9
10
vec4 resize_color(vec3 coords_curr_geo, vec3 size_curr_geo) {
    vec3 coords_tex_prev = niri_geo_to_tex_prev * coords_curr_geo;
    vec4 color_prev = texture2D(niri_tex_prev, coords_tex_prev.st);

    vec3 coords_tex_next = niri_geo_to_tex_next * coords_curr_geo;
    vec4 color_next = texture2D(niri_tex_next, coords_tex_next.st);

    vec4 color = mix(color_prev, color_next, niri_clamped_progress);
    return color;
}