diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-03-03 23:16:54 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-03-03 23:16:54 +0300 |
commit | 58e2ec18ae58918017170c915e7587759f322779 (patch) | |
tree | 8f646ae8a0d73d7cec6840e888d9095e3df3d576 /source/blender/draw/engines/eevee/shaders/infos/eevee_deferred_info.hh | |
parent | fbf4d8f8b5c60313a6ec15c7bd23e12f34b98878 (diff) |
EEVEE: Deferred: Large refactor
This changes drastically the implementation to leverage arbitrary writes
in order to reduce complexity, memory usage and increase speed.
Since we are no longer dependent on the framebuffer requirement, we can
allocate bigger size texture that fits all views and avoid the extra.
Transparency, holdout and emissions are no longer deferred and are now
composited using dual source blending.
The indirect lighting and raytracing is still not functional but will
also gets a large refactor on its own
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/infos/eevee_deferred_info.hh')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/infos/eevee_deferred_info.hh | 74 |
1 files changed, 14 insertions, 60 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/infos/eevee_deferred_info.hh b/source/blender/draw/engines/eevee/shaders/infos/eevee_deferred_info.hh index 7a438b14f44..6c22249349e 100644 --- a/source/blender/draw/engines/eevee/shaders/infos/eevee_deferred_info.hh +++ b/source/blender/draw/engines/eevee/shaders/infos/eevee_deferred_info.hh @@ -7,82 +7,36 @@ GPU_SHADER_CREATE_INFO(eevee_utility_texture).sampler(8, ImageType::FLOAT_2D_ARRAY, "utility_tx"); -GPU_SHADER_CREATE_INFO(eevee_deferred_direct) +#define image_out(slot, qualifier, format, name) \ + image(slot, format, qualifier, ImageType::FLOAT_2D, name, Frequency::PASS) + +GPU_SHADER_CREATE_INFO(eevee_deferred_eval) .do_static_compilation(true) .auto_resource_location(true) .sampler(0, ImageType::FLOAT_2D, "hiz_tx") - .sampler(1, ImageType::FLOAT_2D, "emission_data_tx") .sampler(2, ImageType::FLOAT_2D, "transmit_color_tx") .sampler(3, ImageType::FLOAT_2D, "transmit_normal_tx") .sampler(4, ImageType::FLOAT_2D, "transmit_data_tx") .sampler(5, ImageType::FLOAT_2D, "reflect_color_tx") .sampler(6, ImageType::FLOAT_2D, "reflect_normal_tx") .fragment_out(0, Type::VEC4, "out_combined") - .fragment_out(1, Type::VEC4, "out_diffuse") - .fragment_out(2, Type::VEC3, "out_specular") + /* Renderpasses. */ + // .image_out(0, Qualifier::READ_WRITE, GPU_RGBA16F, "rpass_diffuse_light") + // .image_out(1, Qualifier::READ_WRITE, GPU_RGBA16F, "rpass_specular_light") + /* Raytracing. */ + // .image_out(2, Qualifier::WRITE, GPU_RGBA16F, "ray_data") + /* SubSurfaceScattering. */ + // .image_out(3, Qualifier::WRITE, GPU_RGBA16F, "sss_radiance") .additional_info("eevee_shared", "draw_view") - .fragment_source("eevee_deferred_direct_frag.glsl") + .fragment_source("eevee_deferred_eval_frag.glsl") .additional_info("draw_fullscreen", "eevee_transmittance_data", "eevee_utility_texture", - "eevee_lightprobe_data", + // "eevee_lightprobe_data", "eevee_light_data", "eevee_shadow_data", "eevee_sampling_data"); -/** \} */ - -/* -------------------------------------------------------------------- */ -/** \name Holdout - * \{ */ - -GPU_SHADER_CREATE_INFO(eevee_deferred_holdout) - .do_static_compilation(true) - .sampler(0, ImageType::FLOAT_2D, "combined_tx") - .sampler(1, ImageType::FLOAT_2D, "transparency_data_tx") - .fragment_out(5, Type::VEC3, "out_holdout") - .additional_info("eevee_shared") - .fragment_source("eevee_deferred_holdout_frag.glsl") - .additional_info("draw_fullscreen", "draw_view"); - -/** \} */ - -/* -------------------------------------------------------------------- */ -/** \name Transparency - * \{ */ - -GPU_SHADER_CREATE_INFO(eevee_deferred_transparent) - .do_static_compilation(true) - .sampler(0, ImageType::UINT_2D, "volume_data_tx") - .sampler(1, ImageType::FLOAT_2D, "transparency_data_tx") - .fragment_out(0, Type::VEC4, "out_combined") - .fragment_out(1, Type::VEC3, "out_diffuse") - .fragment_out(2, Type::VEC3, "out_specular") - .fragment_out(3, Type::VEC3, "out_volume") - .fragment_out(4, Type::VEC3, "out_background") - .fragment_out(5, Type::VEC3, "out_holdout") - .additional_info("eevee_shared") - .fragment_source("eevee_deferred_transparent_frag.glsl") - .additional_info("draw_fullscreen", "draw_view", "eevee_light_data"); - -/** \} */ - -/* -------------------------------------------------------------------- */ -/** \name Volume - * \{ */ - -GPU_SHADER_CREATE_INFO(eevee_deferred_volume) - .do_static_compilation(true) - .sampler(0, ImageType::FLOAT_2D, "transparency_data_tx") - .sampler(1, ImageType::UINT_2D, "volume_data_tx") - .fragment_out(0, Type::VEC4, "out_combined") - .fragment_out(1, Type::VEC3, "out_volume") - .additional_info("eevee_shared") - .fragment_source("eevee_deferred_volume_frag.glsl") - .additional_info("draw_fullscreen", - "draw_view", - "eevee_utility_texture", - "eevee_light_data", - "eevee_shadow_data"); +#undef image_out /** \} */ |