From b6649828cd7e78dc8ff05728179711fec5914862 Mon Sep 17 00:00:00 2001 From: clayjohn Date: Tue, 7 Jun 2022 15:01:20 -0700 Subject: Use RenderBuffer size instead of half extents for VIEWPORT_SIZE in Vulkan spatial shaders --- .../renderer_rd/forward_clustered/render_forward_clustered.cpp | 5 ++--- .../rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'servers/rendering') diff --git a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp index 181d7819da..773805e9c7 100644 --- a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp +++ b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp @@ -1256,9 +1256,8 @@ void RenderForwardClustered::_render_scene(RenderDataRD *p_render_data, const Co //scene_state.ubo.subsurface_scatter_width = subsurface_scatter_size; - Vector2 vp_he = p_render_data->cam_projection.get_viewport_half_extents(); - scene_state.ubo.viewport_size[0] = vp_he.x; - scene_state.ubo.viewport_size[1] = vp_he.y; + scene_state.ubo.viewport_size[0] = render_buffer->width; + scene_state.ubo.viewport_size[1] = render_buffer->height; scene_state.ubo.directional_light_count = 0; scene_state.ubo.opaque_prepass_threshold = 0.99f; diff --git a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp index 1cbf804ece..3945f99784 100644 --- a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp +++ b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp @@ -485,9 +485,8 @@ void RenderForwardMobile::_render_scene(RenderDataRD *p_render_data, const Color RENDER_TIMESTAMP("Setup 3D Scene"); - Vector2 vp_he = p_render_data->cam_projection.get_viewport_half_extents(); - scene_state.ubo.viewport_size[0] = vp_he.x; - scene_state.ubo.viewport_size[1] = vp_he.y; + scene_state.ubo.viewport_size[0] = render_buffer->width; + scene_state.ubo.viewport_size[1] = render_buffer->height; scene_state.ubo.directional_light_count = 0; scene_state.ubo.opaque_prepass_threshold = 0.0; -- cgit v1.2.3