Eevee-Next: World Reflective Light #108149

Merged
Jeroen Bakker merged 33 commits from Jeroen-Bakker/blender:eevee-next-world-shader into main 2023-06-29 15:25:04 +02:00
4 changed files with 15 additions and 3 deletions
Showing only changes of commit 1845470a72 - Show all commits

View File

@ -291,7 +291,7 @@ void Instance::render_sample()
}
sampling.step();
capture_view.render();
main_view.render();

View File

@ -195,8 +195,11 @@ void ShadingView::update_view()
void CaptureView::render()
{
// TODO: only do this when world needs to be captured.
if (!world_capture_enable_) {

Replace by inst_.reflection_probes.do_world_update.

Replace by `inst_.reflection_probes.do_world_update`.
return;
}
GPU_debug_group_begin("World.Capture");
View view = {"World.Capture.View"};
for (int face : IndexRange(6)) {
@ -212,6 +215,8 @@ void CaptureView::render()
inst_.pipelines.world.render(view);
}
GPU_texture_update_mipmap_chain(inst_.reflection_probes.cubemaps_tx_);
GPU_debug_group_end();
world_capture_enable_ = false;
}
/** \} */

View File

@ -153,10 +153,16 @@ class CaptureView {
Instance &inst_;
Framebuffer capture_fb_ = {"World.Capture"};
bool world_capture_enable_ = false;
public:
CaptureView(Instance &inst) : inst_(inst) {}
void render();
void world_capture_enable(bool enable)
{
world_capture_enable_ = enable;
}
};
/** \} */

View File

@ -91,6 +91,7 @@ void World::sync()
if (wo_handle.recalc != 0) {
inst_.reflection_probes.set_world_dirty();
inst_.capture_view.world_capture_enable(true);
}
wo_handle.reset_recalc_flag();