diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-09-19 09:03:18 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-09-19 09:03:18 +0200 |
commit | 9a1b4f338b3ea4bf7c3e9746669a43fd1e5560d7 (patch) | |
tree | 809cb5923894b7e3e8ed9e375d1638c134e5db89 /drivers/gles3/shaders | |
parent | 8dfc3f1864c7c372c203769326378093e1083218 (diff) | |
parent | c98ab5aba32827a9c084db480de16dc9ccaa3477 (diff) | |
download | redot-engine-9a1b4f338b3ea4bf7c3e9746669a43fd1e5560d7.tar.gz |
Merge pull request #81160 from paddy-exe/canvas-uv-world-space
Add render mode to use world coordinates in canvas item shader
Diffstat (limited to 'drivers/gles3/shaders')
-rw-r--r-- | drivers/gles3/shaders/canvas.glsl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gles3/shaders/canvas.glsl b/drivers/gles3/shaders/canvas.glsl index e47e3ae9a3..ce8fe25625 100644 --- a/drivers/gles3/shaders/canvas.glsl +++ b/drivers/gles3/shaders/canvas.glsl @@ -199,6 +199,10 @@ void main() { #ifdef USE_POINT_SIZE float point_size = 1.0; #endif + +#ifdef USE_WORLD_VERTEX_COORDS + vertex = (model_matrix * vec4(vertex, 0.0, 1.0)).xy; +#endif { #CODE : VERTEX } @@ -207,7 +211,7 @@ void main() { pixel_size_interp = abs(read_draw_data_dst_rect.zw) * vertex_base; #endif -#if !defined(SKIP_TRANSFORM_USED) +#if !defined(SKIP_TRANSFORM_USED) && !defined(USE_WORLD_VERTEX_COORDS) vertex = (model_matrix * vec4(vertex, 0.0, 1.0)).xy; #endif |