Fix: EEVEE-Next: Artifacts with volume + motion blur
The root cause is still unknown. But replacing the use of the depth texture by the hiz buffer fixes the issue. The issue was apparent on Linux + Mesa + AMD.
This commit is contained in:
@@ -225,7 +225,7 @@ void VolumeModule::end_sync()
|
||||
resolve_ps_.shader_set(inst_.shaders.static_shader_get(VOLUME_RESOLVE));
|
||||
resolve_ps_.bind_resources(inst_.uniform_data);
|
||||
resolve_ps_.bind_resources(this->result);
|
||||
resolve_ps_.bind_texture("depth_tx", &inst_.render_buffers.depth_tx);
|
||||
resolve_ps_.bind_resources(inst_.hiz_buffer.front);
|
||||
resolve_ps_.bind_image(RBUFS_COLOR_SLOT, &inst_.render_buffers.rp_color_tx);
|
||||
resolve_ps_.bind_image(RBUFS_VALUE_SLOT, &inst_.render_buffers.rp_value_tx);
|
||||
/* Sync with the integration pass. */
|
||||
@@ -277,6 +277,8 @@ void VolumeModule::draw_resolve(View &view)
|
||||
return;
|
||||
}
|
||||
|
||||
inst_.hiz_buffer.update();
|
||||
|
||||
resolve_fb_.ensure(GPU_ATTACHMENT_NONE,
|
||||
GPU_ATTACHMENT_TEXTURE(inst_.render_buffers.combined_tx));
|
||||
resolve_fb_.bind();
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 uvs = gl_FragCoord.xy / vec2(textureSize(depth_tx, 0));
|
||||
float scene_depth = texture(depth_tx, uvs).r;
|
||||
vec2 uvs = gl_FragCoord.xy * uniform_buf.volumes.viewport_size_inv;
|
||||
float scene_depth = texelFetch(hiz_tx, ivec2(gl_FragCoord.xy), 0).r;
|
||||
|
||||
VolumeResolveSample vol = volume_resolve(
|
||||
vec3(uvs, scene_depth), volume_transmittance_tx, volume_scattering_tx);
|
||||
|
||||
@@ -94,8 +94,8 @@ GPU_SHADER_CREATE_INFO(eevee_volume_resolve)
|
||||
.additional_info("eevee_volume_lib")
|
||||
.additional_info("draw_fullscreen")
|
||||
.additional_info("eevee_render_pass_out")
|
||||
.additional_info("eevee_hiz_data")
|
||||
.fragment_source("eevee_volume_resolve_frag.glsl")
|
||||
.sampler(0, ImageType::DEPTH_2D, "depth_tx")
|
||||
.fragment_out(0, Type::VEC4, "out_radiance", DualBlend::SRC_0)
|
||||
.fragment_out(0, Type::VEC4, "out_transmittance", DualBlend::SRC_1)
|
||||
/** TODO(Miguel Pozo): Volume RenderPasses. */
|
||||
|
||||
Reference in New Issue
Block a user