1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-17 14:11:06 +00:00

Use a src rect for copying from screen with CanvasGroup in the mobile backend

This commit is contained in:
clayjohn
2024-04-17 15:19:20 -07:00
parent 3b1806182a
commit adfc9ccc44
4 changed files with 20 additions and 3 deletions

View File

@@ -21,6 +21,7 @@
#define FLAG_ALPHA_TO_ONE (1 << 5)
#define FLAG_LINEAR (1 << 6)
#define FLAG_NORMAL (1 << 7)
#define FLAG_USE_SRC_SECTION (1 << 8)
#ifdef USE_MULTIVIEW
layout(location = 0) out vec3 uv_interp;
@@ -54,6 +55,10 @@ void main() {
if (bool(params.flags & FLAG_FLIP_Y)) {
uv_interp.y = 1.0 - uv_interp.y;
}
if (bool(params.flags & FLAG_USE_SRC_SECTION)) {
uv_interp = params.section.xy + uv_interp * params.section.zw;
}
}
#[fragment]