diff options
author | Bastiaan Olij <mux213@gmail.com> | 2022-12-15 22:20:06 +1100 |
---|---|---|
committer | Bastiaan Olij <mux213@gmail.com> | 2022-12-23 19:45:19 +1100 |
commit | e886a7af818be3287deefab9b18f87014ee60182 (patch) | |
tree | 52ee945c7a1f40d10b99454dbecdc45759c26294 /servers/rendering/renderer_rd/renderer_scene_render_rd.cpp | |
parent | 291add339f0228d58226def25c38ea4fdcea6fb5 (diff) |
Cleanup and improve sky render
Diffstat (limited to 'servers/rendering/renderer_rd/renderer_scene_render_rd.cpp')
-rw-r--r-- | servers/rendering/renderer_rd/renderer_scene_render_rd.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp b/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp index 3d84d47333..cf6e0d7bdc 100644 --- a/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp @@ -1002,10 +1002,20 @@ bool RendererSceneRenderRD::is_using_radiance_cubemap_array() const { } void RendererSceneRenderRD::_update_vrs(Ref<RenderSceneBuffersRD> p_render_buffers) { - if (p_render_buffers.is_valid() && vrs) { + if (p_render_buffers.is_null()) { + return; + } + + RID render_target = p_render_buffers->get_render_target(); + if (render_target.is_null()) { + // must be rendering reflection probes + return; + } + + if (vrs) { RendererRD::TextureStorage *texture_storage = RendererRD::TextureStorage::get_singleton(); - RS::ViewportVRSMode vrs_mode = texture_storage->render_target_get_vrs_mode(p_render_buffers->get_render_target()); + RS::ViewportVRSMode vrs_mode = texture_storage->render_target_get_vrs_mode(render_target); if (vrs_mode != RS::VIEWPORT_VRS_DISABLED) { RID vrs_texture = p_render_buffers->get_texture(RB_SCOPE_VRS, RB_TEXTURE); @@ -1157,7 +1167,7 @@ void RendererSceneRenderRD::render_scene(const Ref<RenderSceneBuffers> &p_render } Color clear_color; - if (p_render_buffers.is_valid()) { + if (p_render_buffers.is_valid() && p_reflection_probe.is_null()) { clear_color = texture_storage->render_target_get_clear_request_color(rb->get_render_target()); } else { clear_color = RSG::texture_storage->get_default_clear_color(); |