diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-02-26 18:59:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-26 18:59:50 +0100 |
commit | be4a516b77a07d9c554c31b8a348e1d5c7a04648 (patch) | |
tree | d8833bb72557e7cbf05dce91b2b59209126cdfea | |
parent | 216d2ad31cb0e43d6b5a31f2dcad5fc528633808 (diff) | |
parent | b0ff427a2ad71f6ae86b2ce069c8ecc6981b13e0 (diff) |
Merge pull request #36428 from clayjohn/VULKAN-ref-probe-sky
Properly flip sky when rendering reflection probes
-rw-r--r-- | servers/visual/rasterizer_rd/rasterizer_scene_high_end_rd.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/servers/visual/rasterizer_rd/rasterizer_scene_high_end_rd.cpp b/servers/visual/rasterizer_rd/rasterizer_scene_high_end_rd.cpp index a33c94fbcd..dd6bece11d 100644 --- a/servers/visual/rasterizer_rd/rasterizer_scene_high_end_rd.cpp +++ b/servers/visual/rasterizer_rd/rasterizer_scene_high_end_rd.cpp @@ -1894,8 +1894,16 @@ void RasterizerSceneHighEndRD::_render_scene(RID p_render_buffer, const Transfor if (draw_sky) { RENDER_TIMESTAMP("Render Sky"); + + CameraMatrix projection = p_cam_projection; + if (p_reflection_probe.is_valid()) { + CameraMatrix correction; + correction.set_depth_correction(true); + projection = correction * p_cam_projection; + } + RD::DrawListID draw_list = RD::get_singleton()->draw_list_begin(opaque_framebuffer, RD::INITIAL_ACTION_CONTINUE, can_continue ? RD::FINAL_ACTION_CONTINUE : RD::FINAL_ACTION_READ, RD::INITIAL_ACTION_CONTINUE, can_continue ? RD::FINAL_ACTION_CONTINUE : RD::FINAL_ACTION_READ); - _draw_sky(draw_list, RD::get_singleton()->framebuffer_get_format(opaque_framebuffer), p_environment, p_cam_projection, p_cam_transform, 1.0); + _draw_sky(draw_list, RD::get_singleton()->framebuffer_get_format(opaque_framebuffer), p_environment, projection, p_cam_transform, 1.0); RD::get_singleton()->draw_list_end(); if (using_separate_specular && !can_continue) { |