diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index e95d684763db..6e2822837048 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -867,12 +867,18 @@ uniform highp sampler2DArray color_buffer; // texunit:-5 vec3 multiview_uv(vec2 uv) { return vec3(uv, ViewIndex); } +ivec3 multiview_uv(ivec2 uv) { + return ivec3(uv, int(ViewIndex)); +} #else uniform highp sampler2D depth_buffer; // texunit:-6 uniform highp sampler2D color_buffer; // texunit:-5 vec2 multiview_uv(vec2 uv) { return uv; } +ivec2 multiview_uv(ivec2 uv) { + return uv; +} #endif uniform highp mat4 world_transform; diff --git a/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl b/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl index 930d9814942f..cb95621219ca 100644 --- a/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl +++ b/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl @@ -140,6 +140,9 @@ layout(location = 10) out flat uint instance_index_interp; vec3 multiview_uv(vec2 uv) { return vec3(uv, ViewIndex); } +ivec3 multiview_uv(ivec2 uv) { + return ivec3(uv, int(ViewIndex)); +} layout(location = 11) out vec4 combined_projected; #else // USE_MULTIVIEW // Set to zero, not supported in non stereo @@ -147,6 +150,9 @@ layout(location = 11) out vec4 combined_projected; vec2 multiview_uv(vec2 uv) { return uv; } +ivec2 multiview_uv(ivec2 uv) { + return uv; +} #endif //USE_MULTIVIEW invariant gl_Position; @@ -704,6 +710,9 @@ layout(location = 10) in flat uint instance_index_interp; vec3 multiview_uv(vec2 uv) { return vec3(uv, ViewIndex); } +ivec3 multiview_uv(ivec2 uv) { + return ivec3(uv, int(ViewIndex)); +} layout(location = 11) in vec4 combined_projected; #else // USE_MULTIVIEW // Set to zero, not supported in non stereo @@ -711,6 +720,9 @@ layout(location = 11) in vec4 combined_projected; vec2 multiview_uv(vec2 uv) { return uv; } +ivec2 multiview_uv(ivec2 uv) { + return uv; +} #endif //USE_MULTIVIEW //defines to keep compatibility with vertex diff --git a/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl b/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl index 03737e087cb5..e9c69058f2ae 100644 --- a/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl +++ b/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl @@ -125,12 +125,18 @@ layout(location = 9) out highp float dp_clip; vec3 multiview_uv(vec2 uv) { return vec3(uv, ViewIndex); } +ivec3 multiview_uv(ivec2 uv) { + return ivec3(uv, int(ViewIndex)); +} #else // Set to zero, not supported in non stereo #define ViewIndex 0 vec2 multiview_uv(vec2 uv) { return uv; } +ivec2 multiview_uv(ivec2 uv) { + return uv; +} #endif //USE_MULTIVIEW invariant gl_Position; @@ -568,12 +574,18 @@ layout(location = 9) highp in float dp_clip; vec3 multiview_uv(vec2 uv) { return vec3(uv, ViewIndex); } +ivec3 multiview_uv(ivec2 uv) { + return ivec3(uv, int(ViewIndex)); +} #else // Set to zero, not supported in non stereo #define ViewIndex 0 vec2 multiview_uv(vec2 uv) { return uv; } +ivec2 multiview_uv(ivec2 uv) { + return uv; +} #endif //USE_MULTIVIEW //defines to keep compatibility with vertex