Fix: EEVEE-Next: No shading from lights for volume only scenes
The issue was that the shadow module was never setup by any other pipeline before the volume lighting pass. Fix #121971
This commit is contained in:
@@ -308,7 +308,7 @@ class DeferredLayer : DeferredLayerBase {
|
||||
|
||||
bool is_empty() const
|
||||
{
|
||||
return closure_count_ != 0;
|
||||
return closure_count_ == 0;
|
||||
}
|
||||
|
||||
/* Returns the radiance buffer to feed the next layer. */
|
||||
@@ -369,6 +369,11 @@ class DeferredPipeline {
|
||||
|
||||
void debug_draw(draw::View &view, GPUFrameBuffer *combined_fb);
|
||||
|
||||
bool is_empty() const
|
||||
{
|
||||
return opaque_layer_.is_empty() && refraction_layer_.is_empty();
|
||||
}
|
||||
|
||||
private:
|
||||
void debug_pass_sync();
|
||||
};
|
||||
|
||||
@@ -139,7 +139,7 @@ void ShadingView::render()
|
||||
|
||||
inst_.gbuffer.release();
|
||||
|
||||
inst_.volume.draw_compute(main_view_);
|
||||
inst_.volume.draw_compute(main_view_, extent_);
|
||||
|
||||
// inst_.lookdev.render_overlay(view_fb_);
|
||||
|
||||
|
||||
@@ -377,11 +377,23 @@ void VolumeModule::draw_prepass(View &main_view)
|
||||
DRW_stats_group_end();
|
||||
}
|
||||
|
||||
void VolumeModule::draw_compute(View &main_view)
|
||||
void VolumeModule::draw_compute(View &main_view, int2 extent)
|
||||
{
|
||||
if (!enabled_) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (inst_.pipelines.deferred.is_empty()) {
|
||||
/* This assume the volume are computed after deferred passes. This is needed to avoid broken
|
||||
* lighting and shadowing as the lights are not setup otherwise (see #121971). */
|
||||
inst_.hiz_buffer.swap_layer();
|
||||
inst_.hiz_buffer.update();
|
||||
inst_.volume_probes.set_view(main_view);
|
||||
inst_.sphere_probes.set_view(main_view);
|
||||
inst_.shadows.set_view(main_view, extent);
|
||||
printf("here\n");
|
||||
}
|
||||
|
||||
scatter_tx_.swap();
|
||||
extinction_tx_.swap();
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ class VolumeModule {
|
||||
/* Render material properties. */
|
||||
void draw_prepass(View &main_view);
|
||||
/* Compute scattering and integration. */
|
||||
void draw_compute(View &main_view);
|
||||
void draw_compute(View &main_view, int2 extent);
|
||||
/* Final image compositing. */
|
||||
void draw_resolve(View &view);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user