diff options
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_screen_raytrace.c')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_screen_raytrace.c | 42 |
1 files changed, 4 insertions, 38 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_screen_raytrace.c b/source/blender/draw/engines/eevee/eevee_screen_raytrace.c index f5b4e4d43a5..c49f9ccc48c 100644 --- a/source/blender/draw/engines/eevee/eevee_screen_raytrace.c +++ b/source/blender/draw/engines/eevee/eevee_screen_raytrace.c @@ -126,14 +126,9 @@ void EEVEE_screen_raytrace_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *v EEVEE_EffectsInfo *effects = stl->effects; LightCache *lcache = stl->g_data->light_cache; - struct GPUBatch *quad = DRW_cache_fullscreen_quad_get(); - if ((effects->enabled_effects & EFFECT_SSR) != 0) { - EEVEE_SSRShaderOptions options = (effects->reflection_trace_full) ? SSR_FULL_TRACE : 0; - - struct GPUShader *trace_shader = EEVEE_shaders_effect_screen_raytrace_sh_get(options); - struct GPUShader *resolve_shader = EEVEE_shaders_effect_screen_raytrace_sh_get(SSR_RESOLVE | - options); + struct GPUShader *trace_shader = EEVEE_shaders_effect_reflection_trace_sh_get(); + struct GPUShader *resolve_shader = EEVEE_shaders_effect_reflection_resolve_sh_get(); /** Screen space raytracing overview * @@ -160,10 +155,7 @@ void EEVEE_screen_raytrace_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *v DRW_shgroup_uniform_block(grp, "planar_block", sldata->planar_ubo); DRW_shgroup_uniform_block(grp, "common_block", sldata->common_ubo); DRW_shgroup_uniform_block(grp, "renderpass_block", sldata->renderpass_ubo.combined); - if (!effects->reflection_trace_full) { - DRW_shgroup_uniform_ivec2(grp, "halfresOffset", effects->ssr_halfres_ofs, 1); - } - DRW_shgroup_call(grp, quad, NULL); + DRW_shgroup_call_procedural_triangles(grp, NULL, 1); eGPUSamplerState no_filter = GPU_SAMPLER_DEFAULT; @@ -190,8 +182,7 @@ void EEVEE_screen_raytrace_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *v DRW_shgroup_uniform_block(grp, "renderpass_block", sldata->renderpass_ubo.combined); DRW_shgroup_uniform_int(grp, "neighborOffset", &effects->ssr_neighbor_ofs, 1); DRW_shgroup_uniform_texture_ref(grp, "horizonBuffer", &effects->gtao_horizons); - - DRW_shgroup_call(grp, quad, NULL); + DRW_shgroup_call_procedural_triangles(grp, NULL, 1); } } @@ -230,31 +221,6 @@ void EEVEE_reflection_compute(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *v EEVEE_effects_downsample_radiance_buffer(vedata, txl->color_double_buffer); - /* Resolve at fullres */ - int samp = (DRW_state_is_image_render()) ? effects->taa_render_sample : - effects->taa_current_sample; - /* Doing a neighbor shift only after a few iteration. - * We wait for a prime number of cycles to avoid noise correlation. - * This reduces variance faster. */ - effects->ssr_neighbor_ofs = ((samp / 5) % 8) * 4; - switch ((samp / 11) % 4) { - case 0: - effects->ssr_halfres_ofs[0] = 0; - effects->ssr_halfres_ofs[1] = 0; - break; - case 1: - effects->ssr_halfres_ofs[0] = 0; - effects->ssr_halfres_ofs[1] = 1; - break; - case 2: - effects->ssr_halfres_ofs[0] = 1; - effects->ssr_halfres_ofs[1] = 0; - break; - case 4: - effects->ssr_halfres_ofs[0] = 1; - effects->ssr_halfres_ofs[1] = 1; - break; - } GPU_framebuffer_bind(fbl->main_color_fb); DRW_draw_pass(psl->ssr_resolve); |