Eevee-Next: World Reflective Light #108149
|
@ -291,7 +291,7 @@ void Instance::render_sample()
|
|||
}
|
||||
|
||||
sampling.step();
|
||||
|
||||
|
||||
capture_view.render();
|
||||
main_view.render();
|
||||
|
||||
|
|
|
@ -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_) {
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Replace by
inst_.reflection_probes.do_world_update
.