]> Untitled Git - wolf-seeking-sheep.git/blob - addons/dialogic/Modules/Background/Transitions/push_transition_shader.gdshader
Squashed commit of the following:
[wolf-seeking-sheep.git] / addons / dialogic / Modules / Background / Transitions / push_transition_shader.gdshader
1 shader_type canvas_item;
2
3 uniform vec2 final_offset = vec2(0,-1);
4 uniform float progress: hint_range(0.0, 1.0);
5 uniform sampler2D previous_background: source_color, hint_default_transparent;
6 uniform sampler2D next_background: source_color, hint_default_transparent;
7
8
9 void fragment() {
10         vec2 uv = UV + final_offset * progress*vec2(-1, -1);
11
12         if (uv.x < 1.0 && uv.x > 0.0 && uv.y < 1.0 && uv.y > 0.0){
13                 COLOR = texture(previous_background, uv, 1);
14         } else {
15                 COLOR = texture(next_background, uv-final_offset*vec2(-1,-1));
16         }
17 }