From 91fee3eca8d9b04cfa910d25e10913aac918eabf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cle=CC=81ment=20Foucault?= Date: Wed, 29 May 2024 11:19:50 +0200 Subject: [PATCH] Cleanup: EEVEE-Next: Rename lightprobe files Use new naming convention Pull Request: https://projects.blender.org/blender/blender/pulls/122405 --- source/blender/draw/CMakeLists.txt | 38 +++++++-------- .../draw/engines/eevee_next/eevee_defines.hh | 2 +- .../draw/engines/eevee_next/eevee_instance.cc | 2 +- .../draw/engines/eevee_next/eevee_instance.hh | 8 ++-- ...r_probes.cc => eevee_lightprobe_planar.cc} | 2 +- ...r_probes.hh => eevee_lightprobe_planar.hh} | 0 ...n_probes.cc => eevee_lightprobe_sphere.cc} | 18 +++---- ...n_probes.hh => eevee_lightprobe_sphere.hh} | 2 +- ...ce_cache.cc => eevee_lightprobe_volume.cc} | 2 +- ...ce_cache.hh => eevee_lightprobe_volume.hh} | 0 .../draw/engines/eevee_next/eevee_material.cc | 14 +++--- .../draw/engines/eevee_next/eevee_material.hh | 4 +- .../draw/engines/eevee_next/eevee_shader.cc | 20 ++++---- .../draw/engines/eevee_next/eevee_sync.cc | 16 +++---- .../eevee_debug_irradiance_grid_vert.glsl | 2 +- .../shaders/eevee_deferred_capture_frag.glsl | 2 +- .../shaders/eevee_deferred_planar_frag.glsl | 2 +- .../eevee_display_probe_grid_vert.glsl | 2 +- .../eevee_display_probe_planar_frag.glsl | 4 +- .../eevee_display_probe_reflection_frag.glsl | 4 +- .../eevee_display_probe_reflection_vert.glsl | 2 +- .../shaders/eevee_lightprobe_eval_lib.glsl | 14 +++--- .../shaders/eevee_lightprobe_lib.glsl | 12 ++--- ...evee_lightprobe_sphere_convolve_comp.glsl} | 2 +- ... => eevee_lightprobe_sphere_eval_lib.glsl} | 6 +-- ...ee_lightprobe_sphere_irradiance_comp.glsl} | 4 +- ....glsl => eevee_lightprobe_sphere_lib.glsl} | 16 +++---- ... eevee_lightprobe_sphere_mapping_lib.glsl} | 0 ...> eevee_lightprobe_sphere_remap_comp.glsl} | 2 +- ... eevee_lightprobe_sphere_select_comp.glsl} | 14 +++--- ...evee_lightprobe_sphere_sunlight_comp.glsl} | 4 +- ... eevee_lightprobe_volume_bounds_comp.glsl} | 0 .../eevee_lightprobe_volume_eval_lib.glsl | 47 +++++++++---------- ...=> eevee_lightprobe_volume_load_comp.glsl} | 10 ++-- ... eevee_lightprobe_volume_offset_comp.glsl} | 7 ++- ... => eevee_lightprobe_volume_ray_comp.glsl} | 11 ++--- ...> eevee_lightprobe_volume_world_comp.glsl} | 0 .../shaders/eevee_surf_world_frag.glsl | 6 +-- .../shaders/eevee_surfel_ray_comp.glsl | 4 +- .../shaders/eevee_volume_scatter_comp.glsl | 2 +- ...nfo.hh => eevee_lightprobe_sphere_info.hh} | 34 +++++++------- ...nfo.hh => eevee_lightprobe_volume_info.hh} | 26 +++++----- .../shaders/infos/eevee_material_info.hh | 2 +- source/blender/gpu/CMakeLists.txt | 4 +- 44 files changed, 185 insertions(+), 188 deletions(-) rename source/blender/draw/engines/eevee_next/{eevee_planar_probes.cc => eevee_lightprobe_planar.cc} (99%) rename source/blender/draw/engines/eevee_next/{eevee_planar_probes.hh => eevee_lightprobe_planar.hh} (100%) rename source/blender/draw/engines/eevee_next/{eevee_reflection_probes.cc => eevee_lightprobe_sphere.cc} (95%) rename source/blender/draw/engines/eevee_next/{eevee_reflection_probes.hh => eevee_lightprobe_sphere.hh} (99%) rename source/blender/draw/engines/eevee_next/{eevee_irradiance_cache.cc => eevee_lightprobe_volume.cc} (99%) rename source/blender/draw/engines/eevee_next/{eevee_irradiance_cache.hh => eevee_lightprobe_volume.hh} (100%) rename source/blender/draw/engines/eevee_next/shaders/{eevee_reflection_probe_convolve_comp.glsl => eevee_lightprobe_sphere_convolve_comp.glsl} (98%) rename source/blender/draw/engines/eevee_next/shaders/{eevee_reflection_probe_eval_lib.glsl => eevee_lightprobe_sphere_eval_lib.glsl} (87%) rename source/blender/draw/engines/eevee_next/shaders/{eevee_reflection_probe_irradiance_comp.glsl => eevee_lightprobe_sphere_irradiance_comp.glsl} (94%) rename source/blender/draw/engines/eevee_next/shaders/{eevee_reflection_probe_lib.glsl => eevee_lightprobe_sphere_lib.glsl} (66%) rename source/blender/draw/engines/eevee_next/shaders/{eevee_reflection_probe_mapping_lib.glsl => eevee_lightprobe_sphere_mapping_lib.glsl} (100%) rename source/blender/draw/engines/eevee_next/shaders/{eevee_reflection_probe_remap_comp.glsl => eevee_lightprobe_sphere_remap_comp.glsl} (99%) rename source/blender/draw/engines/eevee_next/shaders/{eevee_reflection_probe_select_comp.glsl => eevee_lightprobe_sphere_select_comp.glsl} (60%) rename source/blender/draw/engines/eevee_next/shaders/{eevee_reflection_probe_sunlight_comp.glsl => eevee_lightprobe_sphere_sunlight_comp.glsl} (96%) rename source/blender/draw/engines/eevee_next/shaders/{eevee_lightprobe_irradiance_bounds_comp.glsl => eevee_lightprobe_volume_bounds_comp.glsl} (100%) rename source/blender/draw/engines/eevee_next/shaders/{eevee_lightprobe_irradiance_load_comp.glsl => eevee_lightprobe_volume_load_comp.glsl} (93%) rename source/blender/draw/engines/eevee_next/shaders/{eevee_lightprobe_irradiance_offset_comp.glsl => eevee_lightprobe_volume_offset_comp.glsl} (96%) rename source/blender/draw/engines/eevee_next/shaders/{eevee_lightprobe_irradiance_ray_comp.glsl => eevee_lightprobe_volume_ray_comp.glsl} (93%) rename source/blender/draw/engines/eevee_next/shaders/{eevee_lightprobe_irradiance_world_comp.glsl => eevee_lightprobe_volume_world_comp.glsl} (100%) rename source/blender/draw/engines/eevee_next/shaders/infos/{eevee_reflection_probe_info.hh => eevee_lightprobe_sphere_info.hh} (80%) rename source/blender/draw/engines/eevee_next/shaders/infos/{eevee_irradiance_cache_info.hh => eevee_lightprobe_volume_info.hh} (92%) diff --git a/source/blender/draw/CMakeLists.txt b/source/blender/draw/CMakeLists.txt index 7cf46e6b4c9..b01fdca36be 100644 --- a/source/blender/draw/CMakeLists.txt +++ b/source/blender/draw/CMakeLists.txt @@ -143,7 +143,7 @@ set(SRC engines/eevee_next/eevee_film.cc engines/eevee_next/eevee_hizbuffer.cc engines/eevee_next/eevee_instance.cc - engines/eevee_next/eevee_irradiance_cache.cc + engines/eevee_next/eevee_lightprobe_volume.cc engines/eevee_next/eevee_light.cc engines/eevee_next/eevee_lightcache.cc engines/eevee_next/eevee_lightprobe.cc @@ -152,10 +152,10 @@ set(SRC engines/eevee_next/eevee_material.cc engines/eevee_next/eevee_motion_blur.cc engines/eevee_next/eevee_pipeline.cc - engines/eevee_next/eevee_planar_probes.cc + engines/eevee_next/eevee_lightprobe_planar.cc engines/eevee_next/eevee_precompute.cc engines/eevee_next/eevee_raytrace.cc - engines/eevee_next/eevee_reflection_probes.cc + engines/eevee_next/eevee_lightprobe_sphere.cc engines/eevee_next/eevee_renderbuffers.cc engines/eevee_next/eevee_sampling.cc engines/eevee_next/eevee_shader.cc @@ -280,7 +280,7 @@ set(SRC engines/eevee_next/eevee_gbuffer.hh engines/eevee_next/eevee_hizbuffer.hh engines/eevee_next/eevee_instance.hh - engines/eevee_next/eevee_irradiance_cache.hh + engines/eevee_next/eevee_lightprobe_volume.hh engines/eevee_next/eevee_light.hh engines/eevee_next/eevee_lightcache.hh engines/eevee_next/eevee_lightprobe.hh @@ -289,10 +289,10 @@ set(SRC engines/eevee_next/eevee_material.hh engines/eevee_next/eevee_motion_blur.hh engines/eevee_next/eevee_pipeline.hh - engines/eevee_next/eevee_planar_probes.hh + engines/eevee_next/eevee_lightprobe_planar.hh engines/eevee_next/eevee_precompute.hh engines/eevee_next/eevee_raytrace.hh - engines/eevee_next/eevee_reflection_probes.hh + engines/eevee_next/eevee_lightprobe_sphere.hh engines/eevee_next/eevee_renderbuffers.hh engines/eevee_next/eevee_sampling.hh engines/eevee_next/eevee_shader.hh @@ -528,11 +528,11 @@ set(GLSL_SRC engines/eevee_next/shaders/eevee_light_iter_lib.glsl engines/eevee_next/shaders/eevee_light_lib.glsl engines/eevee_next/shaders/eevee_lightprobe_eval_lib.glsl - engines/eevee_next/shaders/eevee_lightprobe_irradiance_bounds_comp.glsl - engines/eevee_next/shaders/eevee_lightprobe_irradiance_ray_comp.glsl - engines/eevee_next/shaders/eevee_lightprobe_irradiance_offset_comp.glsl - engines/eevee_next/shaders/eevee_lightprobe_irradiance_load_comp.glsl - engines/eevee_next/shaders/eevee_lightprobe_irradiance_world_comp.glsl + engines/eevee_next/shaders/eevee_lightprobe_volume_bounds_comp.glsl + engines/eevee_next/shaders/eevee_lightprobe_volume_ray_comp.glsl + engines/eevee_next/shaders/eevee_lightprobe_volume_offset_comp.glsl + engines/eevee_next/shaders/eevee_lightprobe_volume_load_comp.glsl + engines/eevee_next/shaders/eevee_lightprobe_volume_world_comp.glsl engines/eevee_next/shaders/eevee_lightprobe_lib.glsl engines/eevee_next/shaders/eevee_lightprobe_volume_eval_lib.glsl engines/eevee_next/shaders/eevee_lookdev_display_frag.glsl @@ -560,14 +560,14 @@ set(GLSL_SRC engines/eevee_next/shaders/eevee_ray_trace_screen_comp.glsl engines/eevee_next/shaders/eevee_ray_trace_screen_lib.glsl engines/eevee_next/shaders/eevee_ray_types_lib.glsl - engines/eevee_next/shaders/eevee_reflection_probe_convolve_comp.glsl - engines/eevee_next/shaders/eevee_reflection_probe_eval_lib.glsl - engines/eevee_next/shaders/eevee_reflection_probe_irradiance_comp.glsl - engines/eevee_next/shaders/eevee_reflection_probe_lib.glsl - engines/eevee_next/shaders/eevee_reflection_probe_mapping_lib.glsl - engines/eevee_next/shaders/eevee_reflection_probe_remap_comp.glsl - engines/eevee_next/shaders/eevee_reflection_probe_select_comp.glsl - engines/eevee_next/shaders/eevee_reflection_probe_sunlight_comp.glsl + engines/eevee_next/shaders/eevee_lightprobe_sphere_convolve_comp.glsl + engines/eevee_next/shaders/eevee_lightprobe_sphere_eval_lib.glsl + engines/eevee_next/shaders/eevee_lightprobe_sphere_irradiance_comp.glsl + engines/eevee_next/shaders/eevee_lightprobe_sphere_lib.glsl + engines/eevee_next/shaders/eevee_lightprobe_sphere_mapping_lib.glsl + engines/eevee_next/shaders/eevee_lightprobe_sphere_remap_comp.glsl + engines/eevee_next/shaders/eevee_lightprobe_sphere_select_comp.glsl + engines/eevee_next/shaders/eevee_lightprobe_sphere_sunlight_comp.glsl engines/eevee_next/shaders/eevee_renderpass_lib.glsl engines/eevee_next/shaders/eevee_sampling_lib.glsl engines/eevee_next/shaders/eevee_shadow_debug_frag.glsl diff --git a/source/blender/draw/engines/eevee_next/eevee_defines.hh b/source/blender/draw/engines/eevee_next/eevee_defines.hh index eae9ac65060..1f5beac0cf6 100644 --- a/source/blender/draw/engines/eevee_next/eevee_defines.hh +++ b/source/blender/draw/engines/eevee_next/eevee_defines.hh @@ -34,7 +34,7 @@ #define CULLING_TILE_GROUP_SIZE 256 /* Reflection Probes. */ -/* When changed update parallel sum loop in `eevee_reflection_probe_remap_comp.glsl`. */ +/* When changed update parallel sum loop in `eevee_lightprobe_sphere_remap_comp.glsl`. */ #define SPHERE_PROBE_REMAP_GROUP_SIZE 32 #define SPHERE_PROBE_GROUP_SIZE 16 #define SPHERE_PROBE_SELECT_GROUP_SIZE 64 diff --git a/source/blender/draw/engines/eevee_next/eevee_instance.cc b/source/blender/draw/engines/eevee_next/eevee_instance.cc index d94b91dfa41..e1f2a52f365 100644 --- a/source/blender/draw/engines/eevee_next/eevee_instance.cc +++ b/source/blender/draw/engines/eevee_next/eevee_instance.cc @@ -352,7 +352,7 @@ void Instance::render_sync() DRW_curves_update(); } -bool Instance::do_reflection_probe_sync() const +bool Instance::do_lightprobe_sphere_sync() const { if (!sphere_probes.update_probes_this_sample_) { return false; diff --git a/source/blender/draw/engines/eevee_next/eevee_instance.hh b/source/blender/draw/engines/eevee_next/eevee_instance.hh index 884f3c83166..b552f42fdcd 100644 --- a/source/blender/draw/engines/eevee_next/eevee_instance.hh +++ b/source/blender/draw/engines/eevee_next/eevee_instance.hh @@ -22,16 +22,16 @@ #include "eevee_film.hh" #include "eevee_gbuffer.hh" #include "eevee_hizbuffer.hh" -#include "eevee_irradiance_cache.hh" #include "eevee_light.hh" #include "eevee_lightprobe.hh" +#include "eevee_lightprobe_planar.hh" +#include "eevee_lightprobe_sphere.hh" +#include "eevee_lightprobe_volume.hh" #include "eevee_lookdev.hh" #include "eevee_material.hh" #include "eevee_motion_blur.hh" #include "eevee_pipeline.hh" -#include "eevee_planar_probes.hh" #include "eevee_raytrace.hh" -#include "eevee_reflection_probes.hh" #include "eevee_renderbuffers.hh" #include "eevee_sampling.hh" #include "eevee_shader.hh" @@ -192,7 +192,7 @@ class Instance { /** * Return true when probe pipeline is used during this sample. */ - bool do_reflection_probe_sync() const; + bool do_lightprobe_sphere_sync() const; bool do_planar_probe_sync() const; /* Render. */ diff --git a/source/blender/draw/engines/eevee_next/eevee_planar_probes.cc b/source/blender/draw/engines/eevee_next/eevee_lightprobe_planar.cc similarity index 99% rename from source/blender/draw/engines/eevee_next/eevee_planar_probes.cc rename to source/blender/draw/engines/eevee_next/eevee_lightprobe_planar.cc index b21ecb643d1..4185b6436ac 100644 --- a/source/blender/draw/engines/eevee_next/eevee_planar_probes.cc +++ b/source/blender/draw/engines/eevee_next/eevee_lightprobe_planar.cc @@ -2,7 +2,7 @@ * * SPDX-License-Identifier: GPL-2.0-or-later */ -#include "eevee_planar_probes.hh" +#include "eevee_lightprobe_planar.hh" #include "eevee_instance.hh" namespace blender::eevee { diff --git a/source/blender/draw/engines/eevee_next/eevee_planar_probes.hh b/source/blender/draw/engines/eevee_next/eevee_lightprobe_planar.hh similarity index 100% rename from source/blender/draw/engines/eevee_next/eevee_planar_probes.hh rename to source/blender/draw/engines/eevee_next/eevee_lightprobe_planar.hh diff --git a/source/blender/draw/engines/eevee_next/eevee_reflection_probes.cc b/source/blender/draw/engines/eevee_next/eevee_lightprobe_sphere.cc similarity index 95% rename from source/blender/draw/engines/eevee_next/eevee_reflection_probes.cc rename to source/blender/draw/engines/eevee_next/eevee_lightprobe_sphere.cc index f462287a315..794e910c984 100644 --- a/source/blender/draw/engines/eevee_next/eevee_reflection_probes.cc +++ b/source/blender/draw/engines/eevee_next/eevee_lightprobe_sphere.cc @@ -2,7 +2,7 @@ * * SPDX-License-Identifier: GPL-2.0-or-later */ -#include "eevee_reflection_probes.hh" +#include "eevee_lightprobe_sphere.hh" #include "eevee_instance.hh" namespace blender::eevee { @@ -91,8 +91,8 @@ void SphereProbeModule::begin_sync() PassSimple &pass = select_ps_; pass.init(); pass.shader_set(instance_.shaders.static_shader_get(SPHERE_PROBE_SELECT)); - pass.push_constant("reflection_probe_count", &reflection_probe_count_); - pass.bind_ssbo("reflection_probe_buf", &data_buf_); + pass.push_constant("lightprobe_sphere_count", &lightprobe_sphere_count_); + pass.bind_ssbo("lightprobe_sphere_buf", &data_buf_); instance_.volume_probes.bind_resources(pass); instance_.sampling.bind_resources(pass); pass.bind_resources(instance_.uniform_data); @@ -155,11 +155,11 @@ void SphereProbeModule::end_sync() * This fixes issues when using a single non-projected sample. Without resetting the * previous rendered viewport will be drawn and reflection probes will not be updated. * #Instance::render_sample */ - if (instance_.do_reflection_probe_sync()) { + if (instance_.do_lightprobe_sphere_sync()) { instance_.sampling.reset(); } /* If we cannot render probes this redraw make sure we request another redraw. */ - if (update_probes_next_sample_ && (instance_.do_reflection_probe_sync() == false)) { + if (update_probes_next_sample_ && (instance_.do_lightprobe_sphere_sync() == false)) { DRW_viewport_request_redraw(); } } @@ -198,7 +198,7 @@ std::optional SphereProbeModule::world_update_inf std::optional SphereProbeModule::probe_update_info_pop() { - if (!instance_.do_reflection_probe_sync()) { + if (!instance_.do_lightprobe_sphere_sync()) { /* Do not update probes during this sample as we did not sync the draw::Passes. */ return std::nullopt; } @@ -254,7 +254,7 @@ void SphereProbeModule::set_view(View & /*view*/) Vector probe_active; for (auto &probe : instance_.light_probes.sphere_map_.values()) { /* Last slot is reserved for the world probe. */ - if (reflection_probe_count_ >= SPHERE_PROBE_MAX - 1) { + if (lightprobe_sphere_count_ >= SPHERE_PROBE_MAX - 1) { break; } if (!probe.use_for_render) { @@ -302,8 +302,8 @@ void SphereProbeModule::set_view(View & /*view*/) } data_buf_.push_update(); - reflection_probe_count_ = probe_id; - dispatch_probe_select_.x = divide_ceil_u(reflection_probe_count_, + lightprobe_sphere_count_ = probe_id; + dispatch_probe_select_.x = divide_ceil_u(lightprobe_sphere_count_, SPHERE_PROBE_SELECT_GROUP_SIZE); instance_.manager->submit(select_ps_); diff --git a/source/blender/draw/engines/eevee_next/eevee_reflection_probes.hh b/source/blender/draw/engines/eevee_next/eevee_lightprobe_sphere.hh similarity index 99% rename from source/blender/draw/engines/eevee_next/eevee_reflection_probes.hh rename to source/blender/draw/engines/eevee_next/eevee_lightprobe_sphere.hh index a454ad3aca3..b1ab74831d3 100644 --- a/source/blender/draw/engines/eevee_next/eevee_reflection_probes.hh +++ b/source/blender/draw/engines/eevee_next/eevee_lightprobe_sphere.hh @@ -80,7 +80,7 @@ class SphereProbeModule { /** World coordinates in the atlas. */ SphereProbeUvArea world_sampling_coord_; /** Number of the probe to process in the select phase. */ - int reflection_probe_count_ = 0; + int lightprobe_sphere_count_ = 0; /** Intermediate buffer to store spherical harmonics. */ StorageArrayBuffer diff --git a/source/blender/draw/engines/eevee_next/eevee_irradiance_cache.cc b/source/blender/draw/engines/eevee_next/eevee_lightprobe_volume.cc similarity index 99% rename from source/blender/draw/engines/eevee_next/eevee_irradiance_cache.cc rename to source/blender/draw/engines/eevee_next/eevee_lightprobe_volume.cc index 080078fa520..149f7debbee 100644 --- a/source/blender/draw/engines/eevee_next/eevee_irradiance_cache.cc +++ b/source/blender/draw/engines/eevee_next/eevee_lightprobe_volume.cc @@ -13,7 +13,7 @@ #include "eevee_instance.hh" -#include "eevee_irradiance_cache.hh" +#include "eevee_lightprobe_volume.hh" namespace blender::eevee { diff --git a/source/blender/draw/engines/eevee_next/eevee_irradiance_cache.hh b/source/blender/draw/engines/eevee_next/eevee_lightprobe_volume.hh similarity index 100% rename from source/blender/draw/engines/eevee_next/eevee_irradiance_cache.hh rename to source/blender/draw/engines/eevee_next/eevee_lightprobe_volume.hh diff --git a/source/blender/draw/engines/eevee_next/eevee_material.cc b/source/blender/draw/engines/eevee_next/eevee_material.cc index 7c9332b7eda..7d83d0f495f 100644 --- a/source/blender/draw/engines/eevee_next/eevee_material.cc +++ b/source/blender/draw/engines/eevee_next/eevee_material.cc @@ -306,8 +306,8 @@ Material &MaterialModule::material_sync(Object *ob, mat.shading = material_pass_get(ob, blender_mat, surface_pipe, geometry_type); mat.capture = material_pass_get(ob, blender_mat, MAT_PIPE_CAPTURE, geometry_type); mat.overlap_masking = MaterialPass(); - mat.reflection_probe_prepass = MaterialPass(); - mat.reflection_probe_shading = MaterialPass(); + mat.lightprobe_sphere_prepass = MaterialPass(); + mat.lightprobe_sphere_shading = MaterialPass(); mat.planar_probe_prepass = MaterialPass(); mat.planar_probe_shading = MaterialPass(); mat.volume_occupancy = MaterialPass(); @@ -322,15 +322,15 @@ Material &MaterialModule::material_sync(Object *ob, mat.overlap_masking = MaterialPass(); mat.capture = MaterialPass(); - if (inst_.do_reflection_probe_sync() && !(ob->visibility_flag & OB_HIDE_PROBE_CUBEMAP)) { - mat.reflection_probe_prepass = material_pass_get( + if (inst_.do_lightprobe_sphere_sync() && !(ob->visibility_flag & OB_HIDE_PROBE_CUBEMAP)) { + mat.lightprobe_sphere_prepass = material_pass_get( ob, blender_mat, MAT_PIPE_PREPASS_DEFERRED, geometry_type, MAT_PROBE_REFLECTION); - mat.reflection_probe_shading = material_pass_get( + mat.lightprobe_sphere_shading = material_pass_get( ob, blender_mat, MAT_PIPE_DEFERRED, geometry_type, MAT_PROBE_REFLECTION); } else { - mat.reflection_probe_prepass = MaterialPass(); - mat.reflection_probe_shading = MaterialPass(); + mat.lightprobe_sphere_prepass = MaterialPass(); + mat.lightprobe_sphere_shading = MaterialPass(); } if (inst_.do_planar_probe_sync() && !(ob->visibility_flag & OB_HIDE_PROBE_PLANAR)) { diff --git a/source/blender/draw/engines/eevee_next/eevee_material.hh b/source/blender/draw/engines/eevee_next/eevee_material.hh index 4d213935331..b845062125e 100644 --- a/source/blender/draw/engines/eevee_next/eevee_material.hh +++ b/source/blender/draw/engines/eevee_next/eevee_material.hh @@ -329,8 +329,8 @@ struct Material { MaterialPass prepass; MaterialPass overlap_masking; MaterialPass capture; - MaterialPass reflection_probe_prepass; - MaterialPass reflection_probe_shading; + MaterialPass lightprobe_sphere_prepass; + MaterialPass lightprobe_sphere_shading; MaterialPass planar_probe_prepass; MaterialPass planar_probe_shading; MaterialPass volume_occupancy; diff --git a/source/blender/draw/engines/eevee_next/eevee_shader.cc b/source/blender/draw/engines/eevee_next/eevee_shader.cc index d8eb70ddfaa..4f7bd7755c7 100644 --- a/source/blender/draw/engines/eevee_next/eevee_shader.cc +++ b/source/blender/draw/engines/eevee_next/eevee_shader.cc @@ -210,25 +210,25 @@ const char *ShaderModule::static_shader_create_info_name_get(eShaderType shader_ case RAY_TILE_COMPACT: return "eevee_ray_tile_compact"; case LIGHTPROBE_IRRADIANCE_BOUNDS: - return "eevee_lightprobe_irradiance_bounds"; + return "eevee_lightprobe_volume_bounds"; case LIGHTPROBE_IRRADIANCE_OFFSET: - return "eevee_lightprobe_irradiance_offset"; + return "eevee_lightprobe_volume_offset"; case LIGHTPROBE_IRRADIANCE_RAY: - return "eevee_lightprobe_irradiance_ray"; + return "eevee_lightprobe_volume_ray"; case LIGHTPROBE_IRRADIANCE_LOAD: - return "eevee_lightprobe_irradiance_load"; + return "eevee_lightprobe_volume_load"; case LIGHTPROBE_IRRADIANCE_WORLD: - return "eevee_lightprobe_irradiance_world"; + return "eevee_lightprobe_volume_world"; case SPHERE_PROBE_CONVOLVE: - return "eevee_reflection_probe_convolve"; + return "eevee_lightprobe_sphere_convolve"; case SPHERE_PROBE_REMAP: - return "eevee_reflection_probe_remap"; + return "eevee_lightprobe_sphere_remap"; case SPHERE_PROBE_IRRADIANCE: - return "eevee_reflection_probe_irradiance"; + return "eevee_lightprobe_sphere_irradiance"; case SPHERE_PROBE_SELECT: - return "eevee_reflection_probe_select"; + return "eevee_lightprobe_sphere_select"; case SPHERE_PROBE_SUNLIGHT: - return "eevee_reflection_probe_sunlight"; + return "eevee_lightprobe_sphere_sunlight"; case SHADOW_CLIPMAP_CLEAR: return "eevee_shadow_clipmap_clear"; case SHADOW_DEBUG: diff --git a/source/blender/draw/engines/eevee_next/eevee_sync.cc b/source/blender/draw/engines/eevee_next/eevee_sync.cc index a6415f9f9ca..9c3d48a8d89 100644 --- a/source/blender/draw/engines/eevee_next/eevee_sync.cc +++ b/source/blender/draw/engines/eevee_next/eevee_sync.cc @@ -152,8 +152,8 @@ void SyncModule::sync_mesh(Object *ob, geometry_call(material.planar_probe_prepass.sub_pass, geom, res_handle); geometry_call(material.planar_probe_shading.sub_pass, geom, res_handle); - geometry_call(material.reflection_probe_prepass.sub_pass, geom, res_handle); - geometry_call(material.reflection_probe_shading.sub_pass, geom, res_handle); + geometry_call(material.lightprobe_sphere_prepass.sub_pass, geom, res_handle); + geometry_call(material.lightprobe_sphere_shading.sub_pass, geom, res_handle); is_alpha_blend = is_alpha_blend || material.is_alpha_blend_transparent; has_transparent_shadows = has_transparent_shadows || material.has_transparent_shadows; @@ -232,8 +232,8 @@ bool SyncModule::sync_sculpt(Object *ob, geometry_call(material.planar_probe_prepass.sub_pass, geom, res_handle); geometry_call(material.planar_probe_shading.sub_pass, geom, res_handle); - geometry_call(material.reflection_probe_prepass.sub_pass, geom, res_handle); - geometry_call(material.reflection_probe_shading.sub_pass, geom, res_handle); + geometry_call(material.lightprobe_sphere_prepass.sub_pass, geom, res_handle); + geometry_call(material.lightprobe_sphere_shading.sub_pass, geom, res_handle); is_alpha_blend = is_alpha_blend || material.is_alpha_blend_transparent; has_transparent_shadows = has_transparent_shadows || material.has_transparent_shadows; @@ -310,8 +310,8 @@ void SyncModule::sync_point_cloud(Object *ob, drawcall_add(material.planar_probe_prepass); drawcall_add(material.planar_probe_shading); - drawcall_add(material.reflection_probe_prepass); - drawcall_add(material.reflection_probe_shading); + drawcall_add(material.lightprobe_sphere_prepass); + drawcall_add(material.lightprobe_sphere_shading); inst_.cryptomatte.sync_object(ob, res_handle); GPUMaterial *gpu_material = material.shading.gpumat; @@ -574,8 +574,8 @@ void SyncModule::sync_curves(Object *ob, drawcall_add(material.planar_probe_prepass); drawcall_add(material.planar_probe_shading); - drawcall_add(material.reflection_probe_prepass); - drawcall_add(material.reflection_probe_shading); + drawcall_add(material.lightprobe_sphere_prepass); + drawcall_add(material.lightprobe_sphere_shading); inst_.cryptomatte.sync_object(ob, res_handle); GPUMaterial *gpu_material = material.shading.gpumat; diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_debug_irradiance_grid_vert.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_debug_irradiance_grid_vert.glsl index 3754855fe2b..f49a8b84684 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_debug_irradiance_grid_vert.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_debug_irradiance_grid_vert.glsl @@ -23,7 +23,7 @@ void main() grid_sample.y = (sample_id / grid_resolution.x) % grid_resolution.y; grid_sample.z = (sample_id / (grid_resolution.x * grid_resolution.y)); - vec3 P = lightprobe_irradiance_grid_sample_position(grid_mat, grid_resolution, grid_sample); + vec3 P = lightprobe_volume_grid_sample_position(grid_mat, grid_resolution, grid_sample); vec4 debug_data = texelFetch(debug_data_tx, grid_sample, 0); if (debug_mode == DEBUG_IRRADIANCE_CACHE_VALIDITY) { diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_deferred_capture_frag.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_deferred_capture_frag.glsl index d53480dce58..4da0e481502 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_deferred_capture_frag.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_deferred_capture_frag.glsl @@ -72,7 +72,7 @@ void main() /* Indirect light. */ /* Can only load irradiance to avoid dependency loop with the reflection probe. */ - SphericalHarmonicL1 sh = lightprobe_irradiance_sample(P, V, Ng); + SphericalHarmonicL1 sh = lightprobe_volume_sample(P, V, Ng); radiance_front += spherical_harmonics_evaluate_lambert(Ng, sh); /* TODO(fclem): Correct transmission eval. */ diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_deferred_planar_frag.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_deferred_planar_frag.glsl index 0599a485381..baeea9b09ff 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_deferred_planar_frag.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_deferred_planar_frag.glsl @@ -66,7 +66,7 @@ void main() vec3 radiance_back = stack.cl[0].light_shadowed; /* Indirect light. */ - SphericalHarmonicL1 sh = lightprobe_irradiance_sample(P, V, Ng); + SphericalHarmonicL1 sh = lightprobe_volume_sample(P, V, Ng); radiance_front += spherical_harmonics_evaluate_lambert(Ng, sh); radiance_back += spherical_harmonics_evaluate_lambert(-Ng, sh); diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_display_probe_grid_vert.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_display_probe_grid_vert.glsl index 968310d660a..3ee9742ce00 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_display_probe_grid_vert.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_display_probe_grid_vert.glsl @@ -26,7 +26,7 @@ void main() (cell_index / grid_res.z) % grid_res.y, cell_index % grid_res.z); - vec3 ws_cell_pos = lightprobe_irradiance_grid_sample_position(grid_to_world, grid_res, cell); + vec3 ws_cell_pos = lightprobe_volume_grid_sample_position(grid_to_world, grid_res, cell); float sphere_radius_final = sphere_radius; if (display_validity) { diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_display_probe_planar_frag.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_display_probe_planar_frag.glsl index 7be1b0c9a26..1b3cbeade74 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_display_probe_planar_frag.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_display_probe_planar_frag.glsl @@ -3,7 +3,7 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ #pragma BLENDER_REQUIRE(draw_view_lib.glsl) -#pragma BLENDER_REQUIRE(eevee_reflection_probe_lib.glsl) +#pragma BLENDER_REQUIRE(eevee_lightprobe_sphere_lib.glsl) void main() { @@ -16,7 +16,7 @@ void main() vec3 R = -reflect(V, probe_normal); SphereProbeUvArea world_atlas_coord = reinterpret_as_atlas_coord(world_coord_packed); - out_color = reflection_probes_sample(R, 0.0, world_atlas_coord); + out_color = lightprobe_spheres_sample(R, 0.0, world_atlas_coord); } else { out_color = texture(planar_radiance_tx, vec3(uv, probe_index)); diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_display_probe_reflection_frag.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_display_probe_reflection_frag.glsl index f8ca7910ead..1ff6af4c474 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_display_probe_reflection_frag.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_display_probe_reflection_frag.glsl @@ -3,7 +3,7 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ #pragma BLENDER_REQUIRE(draw_view_lib.glsl) -#pragma BLENDER_REQUIRE(eevee_reflection_probe_lib.glsl) +#pragma BLENDER_REQUIRE(eevee_lightprobe_sphere_lib.glsl) void main() { @@ -20,6 +20,6 @@ void main() vec3 V = drw_world_incident_vector(P); vec3 L = reflect(-V, N); - out_color = reflection_probes_sample(L, 0, reflection_probe_buf[probe_index].atlas_coord); + out_color = lightprobe_spheres_sample(L, 0, lightprobe_sphere_buf[probe_index].atlas_coord); out_color.a = 0.0; } diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_display_probe_reflection_vert.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_display_probe_reflection_vert.glsl index 9f1c8b9079f..db132f8c860 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_display_probe_reflection_vert.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_display_probe_reflection_vert.glsl @@ -23,7 +23,7 @@ void main() probe_index = display_data_buf[display_index].probe_index; float sphere_radius = display_data_buf[display_index].display_size; - vec3 ws_probe_pos = reflection_probe_buf[probe_index].location; + vec3 ws_probe_pos = lightprobe_sphere_buf[probe_index].location; vec3 vs_offset = vec3(lP, 0.0) * sphere_radius; vec3 vP = drw_point_world_to_view(ws_probe_pos) + vs_offset; diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_eval_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_eval_lib.glsl index d5a78989c8f..4b1b72098f3 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_eval_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_eval_lib.glsl @@ -8,7 +8,7 @@ #pragma BLENDER_REQUIRE(eevee_bxdf_lib.glsl) #pragma BLENDER_REQUIRE(eevee_lightprobe_lib.glsl) #pragma BLENDER_REQUIRE(eevee_ray_generate_lib.glsl) -#pragma BLENDER_REQUIRE(eevee_reflection_probe_eval_lib.glsl) +#pragma BLENDER_REQUIRE(eevee_lightprobe_sphere_eval_lib.glsl) #pragma BLENDER_REQUIRE(eevee_lightprobe_volume_eval_lib.glsl) #pragma BLENDER_REQUIRE(eevee_sampling_lib.glsl) #pragma BLENDER_REQUIRE(eevee_spherical_harmonics_lib.glsl) @@ -33,8 +33,8 @@ LightProbeSample lightprobe_load(vec3 P, vec3 Ng, vec3 V) noise = fract(noise + sampling_rng_1D_get(SAMPLING_LIGHTPROBE)); LightProbeSample result; - result.volume_irradiance = lightprobe_irradiance_sample(P, V, Ng); - result.spherical_id = reflection_probes_select(P, noise); + result.volume_irradiance = lightprobe_volume_sample(P, V, Ng); + result.spherical_id = lightprobe_spheres_select(P, noise); return result; } @@ -70,13 +70,13 @@ vec3 lightprobe_spherical_sample_normalized_with_parallax(LightProbeSample samp, vec3 L, float lod) { - SphereProbeData probe = reflection_probe_buf[samp.spherical_id]; - ReflectionProbeLowFreqLight shading_sh = reflection_probes_extract_low_freq( + SphereProbeData probe = lightprobe_sphere_buf[samp.spherical_id]; + ReflectionProbeLowFreqLight shading_sh = lightprobe_spheres_extract_low_freq( samp.volume_irradiance); - float normalization_factor = reflection_probes_normalization_eval( + float normalization_factor = lightprobe_spheres_normalization_eval( L, shading_sh, probe.low_freq_light); L = lightprobe_sphere_parallax(probe, P, L); - return normalization_factor * reflection_probes_sample(L, lod, probe.atlas_coord).rgb; + return normalization_factor * lightprobe_spheres_sample(L, lod, probe.atlas_coord).rgb; } float pdf_to_lod(float pdf) diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_lib.glsl index 4472c561cdc..d459089acf1 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_lib.glsl @@ -12,9 +12,9 @@ * `grid_res` is the un-padded grid resolution. * `cell_coord` is the coordinate of the sample in [0..grid_res) range. */ -vec3 lightprobe_irradiance_grid_sample_position(mat4 grid_local_to_world_mat, - ivec3 grid_res, - ivec3 cell_coord) +vec3 lightprobe_volume_grid_sample_position(mat4 grid_local_to_world_mat, + ivec3 grid_res, + ivec3 cell_coord) { vec3 ls_cell_pos = (vec3(cell_coord + 1)) / vec3(grid_res + 1); ls_cell_pos = ls_cell_pos * 2.0 - 1.0; @@ -26,7 +26,7 @@ vec3 lightprobe_irradiance_grid_sample_position(mat4 grid_local_to_world_mat, * Return true if sample position is valid. * \a r_lP is the local position in grid units [0..grid_size). */ -bool lightprobe_irradiance_grid_local_coord(VolumeProbeData grid_data, vec3 P, out vec3 r_lP) +bool lightprobe_volume_grid_local_coord(VolumeProbeData grid_data, vec3 P, out vec3 r_lP) { /* Position in cell units. */ /* NOTE: The vector-matrix multiplication swapped on purpose to cancel the matrix transpose. */ @@ -36,7 +36,7 @@ bool lightprobe_irradiance_grid_local_coord(VolumeProbeData grid_data, vec3 P, o return all(equal(lP, r_lP)); } -int lightprobe_irradiance_grid_brick_index_get(VolumeProbeData grid_data, ivec3 brick_coord) +int lightprobe_volume_grid_brick_index_get(VolumeProbeData grid_data, ivec3 brick_coord) { int3 grid_size_in_bricks = divide_ceil(grid_data.grid_size_padded, int3(IRRADIANCE_GRID_BRICK_SIZE - 1)); @@ -48,7 +48,7 @@ int lightprobe_irradiance_grid_brick_index_get(VolumeProbeData grid_data, ivec3 } /* Return cell corner from a corner ID [0..7]. */ -ivec3 lightprobe_irradiance_grid_cell_corner(int cell_corner_id) +ivec3 lightprobe_volume_grid_cell_corner(int cell_corner_id) { return (ivec3(cell_corner_id) >> ivec3(0, 1, 2)) & 1; } diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_convolve_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_sphere_convolve_comp.glsl similarity index 98% rename from source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_convolve_comp.glsl rename to source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_sphere_convolve_comp.glsl index 39799634c61..c8b29f7df1c 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_convolve_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_sphere_convolve_comp.glsl @@ -7,7 +7,7 @@ #pragma BLENDER_REQUIRE(gpu_shader_utildefines_lib.glsl) #pragma BLENDER_REQUIRE(gpu_shader_math_base_lib.glsl) #pragma BLENDER_REQUIRE(gpu_shader_math_matrix_lib.glsl) -#pragma BLENDER_REQUIRE(eevee_reflection_probe_mapping_lib.glsl) +#pragma BLENDER_REQUIRE(eevee_lightprobe_sphere_mapping_lib.glsl) #pragma BLENDER_REQUIRE(eevee_sampling_lib.glsl) /* Bypass convolution cascade and projection logic. */ diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_eval_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_sphere_eval_lib.glsl similarity index 87% rename from source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_eval_lib.glsl rename to source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_sphere_eval_lib.glsl index e14e73b44e0..a1c755ee8ac 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_eval_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_sphere_eval_lib.glsl @@ -6,13 +6,13 @@ #pragma BLENDER_REQUIRE(gpu_shader_codegen_lib.glsl) #pragma BLENDER_REQUIRE(eevee_sampling_lib.glsl) #pragma BLENDER_REQUIRE(eevee_bxdf_sampling_lib.glsl) -#pragma BLENDER_REQUIRE(eevee_reflection_probe_lib.glsl) +#pragma BLENDER_REQUIRE(eevee_lightprobe_sphere_lib.glsl) #ifdef SPHERE_PROBE -int reflection_probes_select(vec3 P, float random_probe) +int lightprobe_spheres_select(vec3 P, float random_probe) { for (int index = 0; index < SPHERE_PROBE_MAX; index++) { - SphereProbeData probe_data = reflection_probe_buf[index]; + SphereProbeData probe_data = lightprobe_sphere_buf[index]; /* SphereProbeData doesn't contain any gap, exit at first item that is invalid. */ if (probe_data.atlas_coord.layer == -1) { /* We hit the end of the array. Return last valid index. */ diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_irradiance_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_sphere_irradiance_comp.glsl similarity index 94% rename from source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_irradiance_comp.glsl rename to source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_sphere_irradiance_comp.glsl index c7b5296d332..e57c32b18b4 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_irradiance_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_sphere_irradiance_comp.glsl @@ -5,8 +5,8 @@ /* Sum all spherical harmonic coefficients extracting during remapping to octahedral map. * Dispatch only one thread-group that sums. */ -#pragma BLENDER_REQUIRE(eevee_reflection_probe_lib.glsl) -#pragma BLENDER_REQUIRE(eevee_reflection_probe_mapping_lib.glsl) +#pragma BLENDER_REQUIRE(eevee_lightprobe_sphere_lib.glsl) +#pragma BLENDER_REQUIRE(eevee_lightprobe_sphere_mapping_lib.glsl) #pragma BLENDER_REQUIRE(eevee_spherical_harmonics_lib.glsl) #pragma BLENDER_REQUIRE(eevee_sampling_lib.glsl) diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_sphere_lib.glsl similarity index 66% rename from source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_lib.glsl rename to source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_sphere_lib.glsl index a6ec363e1ce..3c2b4fb642e 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_sphere_lib.glsl @@ -5,10 +5,10 @@ #pragma BLENDER_REQUIRE(gpu_shader_math_vector_lib.glsl) #pragma BLENDER_REQUIRE(eevee_octahedron_lib.glsl) #pragma BLENDER_REQUIRE(eevee_spherical_harmonics_lib.glsl) -#pragma BLENDER_REQUIRE(eevee_reflection_probe_mapping_lib.glsl) +#pragma BLENDER_REQUIRE(eevee_lightprobe_sphere_mapping_lib.glsl) #ifdef SPHERE_PROBE -vec4 reflection_probes_sample(vec3 L, float lod, SphereProbeUvArea uv_area) +vec4 lightprobe_spheres_sample(vec3 L, float lod, SphereProbeUvArea uv_area) { float lod_min = floor(lod); float lod_max = ceil(lod); @@ -17,13 +17,13 @@ vec4 reflection_probes_sample(vec3 L, float lod, SphereProbeUvArea uv_area) vec2 altas_uv_min, altas_uv_max; sphere_probe_direction_to_uv(L, lod_min, lod_max, uv_area, altas_uv_min, altas_uv_max); - vec4 color_min = textureLod(reflection_probes_tx, vec3(altas_uv_min, uv_area.layer), lod_min); - vec4 color_max = textureLod(reflection_probes_tx, vec3(altas_uv_max, uv_area.layer), lod_max); + vec4 color_min = textureLod(lightprobe_spheres_tx, vec3(altas_uv_min, uv_area.layer), lod_min); + vec4 color_max = textureLod(lightprobe_spheres_tx, vec3(altas_uv_max, uv_area.layer), lod_max); return mix(color_min, color_max, mix_fac); } #endif -ReflectionProbeLowFreqLight reflection_probes_extract_low_freq(SphericalHarmonicL1 sh) +ReflectionProbeLowFreqLight lightprobe_spheres_extract_low_freq(SphericalHarmonicL1 sh) { /* To avoid color shift and negative values, we reduce saturation and directionality. */ ReflectionProbeLowFreqLight result; @@ -42,9 +42,9 @@ ReflectionProbeLowFreqLight reflection_probes_extract_low_freq(SphericalHarmonic return result; } -float reflection_probes_normalization_eval(vec3 L, - ReflectionProbeLowFreqLight numerator, - ReflectionProbeLowFreqLight denominator) +float lightprobe_spheres_normalization_eval(vec3 L, + ReflectionProbeLowFreqLight numerator, + ReflectionProbeLowFreqLight denominator) { /* TODO(fclem): Adjusting directionality is tricky. * Needs to be revisited later on. For now only use the ambient term. */ diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_mapping_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_sphere_mapping_lib.glsl similarity index 100% rename from source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_mapping_lib.glsl rename to source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_sphere_mapping_lib.glsl diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_remap_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_sphere_remap_comp.glsl similarity index 99% rename from source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_remap_comp.glsl rename to source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_sphere_remap_comp.glsl index b3a393e530f..05792f87be3 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_remap_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_sphere_remap_comp.glsl @@ -4,7 +4,7 @@ /* Shader to convert cube-map to octahedral projection. */ -#pragma BLENDER_REQUIRE(eevee_reflection_probe_mapping_lib.glsl) +#pragma BLENDER_REQUIRE(eevee_lightprobe_sphere_mapping_lib.glsl) #pragma BLENDER_REQUIRE(eevee_colorspace_lib.glsl) #pragma BLENDER_REQUIRE(eevee_spherical_harmonics_lib.glsl) diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_select_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_sphere_select_comp.glsl similarity index 60% rename from source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_select_comp.glsl rename to source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_sphere_select_comp.glsl index 14858097dd8..b8c5ed9bdf5 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_select_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_sphere_select_comp.glsl @@ -7,27 +7,27 @@ * irradiance cache from each spherical probe location except for the world probe. */ -#pragma BLENDER_REQUIRE(eevee_reflection_probe_lib.glsl) +#pragma BLENDER_REQUIRE(eevee_lightprobe_sphere_lib.glsl) #pragma BLENDER_REQUIRE(eevee_lightprobe_volume_eval_lib.glsl) void main() { int idx = int(gl_GlobalInvocationID.x); - if (idx >= reflection_probe_count) { + if (idx >= lightprobe_sphere_count) { return; } SphericalHarmonicL1 sh; - if (idx == reflection_probe_count - 1) { - sh = lightprobe_irradiance_world(); + if (idx == lightprobe_sphere_count - 1) { + sh = lightprobe_volume_world(); } else { - vec3 probe_center = reflection_probe_buf[idx].location; - sh = lightprobe_irradiance_sample(probe_center); + vec3 probe_center = lightprobe_sphere_buf[idx].location; + sh = lightprobe_volume_sample(probe_center); } float clamp_indirect_sh = uniform_buf.clamp.surface_indirect; sh = spherical_harmonics_clamp(sh, clamp_indirect_sh); - reflection_probe_buf[idx].low_freq_light = reflection_probes_extract_low_freq(sh); + lightprobe_sphere_buf[idx].low_freq_light = lightprobe_spheres_extract_low_freq(sh); } diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_sunlight_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_sphere_sunlight_comp.glsl similarity index 96% rename from source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_sunlight_comp.glsl rename to source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_sphere_sunlight_comp.glsl index 6d8557167f3..6bad0e69ea7 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_sunlight_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_sphere_sunlight_comp.glsl @@ -6,8 +6,8 @@ * Dispatch only one thread-group that sums. */ #pragma BLENDER_REQUIRE(gpu_shader_math_matrix_lib.glsl) -#pragma BLENDER_REQUIRE(eevee_reflection_probe_lib.glsl) -#pragma BLENDER_REQUIRE(eevee_reflection_probe_mapping_lib.glsl) +#pragma BLENDER_REQUIRE(eevee_lightprobe_sphere_lib.glsl) +#pragma BLENDER_REQUIRE(eevee_lightprobe_sphere_mapping_lib.glsl) #pragma BLENDER_REQUIRE(eevee_spherical_harmonics_lib.glsl) #pragma BLENDER_REQUIRE(eevee_sampling_lib.glsl) diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_irradiance_bounds_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_volume_bounds_comp.glsl similarity index 100% rename from source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_irradiance_bounds_comp.glsl rename to source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_volume_bounds_comp.glsl diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_volume_eval_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_volume_eval_lib.glsl index c935033407f..cd6268d7a4a 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_volume_eval_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_volume_eval_lib.glsl @@ -20,7 +20,7 @@ /** * Return the brick coordinate inside the grid. */ -ivec3 lightprobe_irradiance_grid_brick_coord(vec3 lP) +ivec3 lightprobe_volume_grid_brick_coord(vec3 lP) { ivec3 brick_coord = ivec3((lP - 0.5) / float(IRRADIANCE_GRID_BRICK_SIZE - 1)); /* Avoid sampling adjacent bricks. */ @@ -30,9 +30,9 @@ ivec3 lightprobe_irradiance_grid_brick_coord(vec3 lP) /** * Return the local coordinated of the shading point inside the brick in unnormalized coordinate. */ -vec3 lightprobe_irradiance_grid_brick_local_coord(VolumeProbeData grid_data, - vec3 lP, - ivec3 brick_coord) +vec3 lightprobe_volume_grid_brick_local_coord(VolumeProbeData grid_data, + vec3 lP, + ivec3 brick_coord) { /* Avoid sampling adjacent bricks around the origin. */ lP = max(lP, vec3(0.5)); @@ -44,10 +44,10 @@ vec3 lightprobe_irradiance_grid_brick_local_coord(VolumeProbeData grid_data, /** * Return the biased local brick local coordinated. */ -vec3 lightprobe_irradiance_grid_bias_sample_coord(VolumeProbeData grid_data, - uvec2 brick_atlas_coord, - vec3 brick_lP, - vec3 lNg) +vec3 lightprobe_volume_grid_bias_sample_coord(VolumeProbeData grid_data, + uvec2 brick_atlas_coord, + vec3 brick_lP, + vec3 lNg) { /* A cell is the interpolation region between 8 texels. */ vec3 cell_lP = brick_lP - 0.5; @@ -78,7 +78,7 @@ vec3 lightprobe_irradiance_grid_bias_sample_coord(VolumeProbeData grid_data, float trilinear_weights[8]; float total_weight = 0.0; for (int i = 0; i < 8; i++) { - ivec3 sample_position = lightprobe_irradiance_grid_cell_corner(i); + ivec3 sample_position = lightprobe_volume_grid_cell_corner(i); vec3 trilinear = select(1.0 - cell_fract, cell_fract, bvec3(sample_position)); float positional_weight = trilinear.x * trilinear.y * trilinear.z; @@ -109,7 +109,7 @@ vec3 lightprobe_irradiance_grid_bias_sample_coord(VolumeProbeData grid_data, return 0.5 + cell_start + trilinear_coord; } -SphericalHarmonicL1 lightprobe_irradiance_sample_atlas(sampler3D atlas_tx, vec3 atlas_coord) +SphericalHarmonicL1 lightprobe_volume_sample_atlas(sampler3D atlas_tx, vec3 atlas_coord) { vec4 texture_coord = vec4(atlas_coord, float(IRRADIANCE_GRID_BRICK_SIZE)) / vec3(textureSize(atlas_tx, 0)).xyzz; @@ -124,7 +124,7 @@ SphericalHarmonicL1 lightprobe_irradiance_sample_atlas(sampler3D atlas_tx, vec3 return sh; } -SphericalHarmonicL1 lightprobe_irradiance_sample( +SphericalHarmonicL1 lightprobe_volume_sample( sampler3D atlas_tx, vec3 P, vec3 V, vec3 Ng, const bool do_bias) { vec3 lP; @@ -152,7 +152,7 @@ SphericalHarmonicL1 lightprobe_irradiance_sample( } /* If sample fall inside the grid, step out of the loop. */ - if (lightprobe_irradiance_grid_local_coord(grids_infos_buf[i], P, lP)) { + if (lightprobe_volume_grid_local_coord(grids_infos_buf[i], P, lP)) { index = i; #ifdef IRRADIANCE_GRID_SAMPLING float distance_to_border = reduce_min( @@ -181,33 +181,32 @@ SphericalHarmonicL1 lightprobe_irradiance_sample( lNg = vec3(0.0); } - ivec3 brick_coord = lightprobe_irradiance_grid_brick_coord(lP); - int brick_index = lightprobe_irradiance_grid_brick_index_get(grid_data, brick_coord); + ivec3 brick_coord = lightprobe_volume_grid_brick_coord(lP); + int brick_index = lightprobe_volume_grid_brick_index_get(grid_data, brick_coord); IrradianceBrick brick = irradiance_brick_unpack(bricks_infos_buf[brick_index]); - vec3 brick_lP = lightprobe_irradiance_grid_brick_local_coord(grid_data, lP, brick_coord); + vec3 brick_lP = lightprobe_volume_grid_brick_local_coord(grid_data, lP, brick_coord); /* Sampling point bias. */ - brick_lP = lightprobe_irradiance_grid_bias_sample_coord( - grid_data, brick.atlas_coord, brick_lP, lNg); + brick_lP = lightprobe_volume_grid_bias_sample_coord(grid_data, brick.atlas_coord, brick_lP, lNg); vec3 atlas_coord = vec3(vec2(brick.atlas_coord), 0.0) + brick_lP; - return lightprobe_irradiance_sample_atlas(atlas_tx, atlas_coord); + return lightprobe_volume_sample_atlas(atlas_tx, atlas_coord); } -SphericalHarmonicL1 lightprobe_irradiance_world() +SphericalHarmonicL1 lightprobe_volume_world() { /* We need a 0.5 offset because of filtering. */ - return lightprobe_irradiance_sample_atlas(irradiance_atlas_tx, vec3(0.5001)); + return lightprobe_volume_sample_atlas(irradiance_atlas_tx, vec3(0.5001)); } -SphericalHarmonicL1 lightprobe_irradiance_sample(vec3 P) +SphericalHarmonicL1 lightprobe_volume_sample(vec3 P) { - return lightprobe_irradiance_sample(irradiance_atlas_tx, P, vec3(0), vec3(0), false); + return lightprobe_volume_sample(irradiance_atlas_tx, P, vec3(0), vec3(0), false); } -SphericalHarmonicL1 lightprobe_irradiance_sample(vec3 P, vec3 V, vec3 Ng) +SphericalHarmonicL1 lightprobe_volume_sample(vec3 P, vec3 V, vec3 Ng) { - return lightprobe_irradiance_sample(irradiance_atlas_tx, P, V, Ng, true); + return lightprobe_volume_sample(irradiance_atlas_tx, P, V, Ng, true); } diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_irradiance_load_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_volume_load_comp.glsl similarity index 93% rename from source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_irradiance_load_comp.glsl rename to source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_volume_load_comp.glsl index 3feb184d4ad..40f69df59d2 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_irradiance_load_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_volume_load_comp.glsl @@ -43,8 +43,8 @@ SphericalHarmonicL1 irradiance_load(ivec3 input_coord) void main() { - int brick_index = lightprobe_irradiance_grid_brick_index_get(grids_infos_buf[grid_index], - ivec3(gl_WorkGroupID)); + int brick_index = lightprobe_volume_grid_brick_index_get(grids_infos_buf[grid_index], + ivec3(gl_WorkGroupID)); ivec3 grid_size = textureSize(irradiance_a_tx, 0); /* Brick coordinate in the source grid. */ @@ -113,9 +113,9 @@ void main() sh_visibility.L1.M0 = sh_local.L1.M0.aaaa; sh_visibility.L1.Mp1 = sh_local.L1.Mp1.aaaa; - vec3 P = lightprobe_irradiance_grid_sample_position(grid_local_to_world, grid_size, input_coord); + vec3 P = lightprobe_volume_grid_sample_position(grid_local_to_world, grid_size, input_coord); - SphericalHarmonicL1 sh_distant = lightprobe_irradiance_sample(P); + SphericalHarmonicL1 sh_distant = lightprobe_volume_sample(P); if (is_padding_voxel) { /* Padding voxels just contain the distant lighting. */ @@ -143,7 +143,7 @@ void main() /* Encode validity of each samples in the grid cell. */ for (int cell = 0; cell < 4; cell++) { for (int i = 0; i < 8; i++) { - ivec3 offset = lightprobe_irradiance_grid_cell_corner(i); + ivec3 offset = lightprobe_volume_grid_cell_corner(i); ivec3 coord_output = texel_coord + offset + ivec3(0, 0, cell); ivec3 coord_input = clamp(texel_coord, ivec3(0), grid_size - 1); float validity = texelFetch(validity_tx, coord_input, 0).r; diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_irradiance_offset_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_volume_offset_comp.glsl similarity index 96% rename from source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_irradiance_offset_comp.glsl rename to source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_volume_offset_comp.glsl index 72b1896a31f..5eaa685d969 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_irradiance_offset_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_volume_offset_comp.glsl @@ -166,10 +166,9 @@ void main() return; } - vec3 P = lightprobe_irradiance_grid_sample_position( - capture_info_buf.irradiance_grid_local_to_world, - capture_info_buf.irradiance_grid_size, - grid_coord); + vec3 P = lightprobe_volume_grid_sample_position(capture_info_buf.irradiance_grid_local_to_world, + capture_info_buf.irradiance_grid_size, + grid_coord); int closest_surfel_id = find_closest_surfel(grid_coord, P); if (closest_surfel_id == -1) { diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_irradiance_ray_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_volume_ray_comp.glsl similarity index 93% rename from source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_irradiance_ray_comp.glsl rename to source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_volume_ray_comp.glsl index c50fe6b5bc7..35e9cce543e 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_irradiance_ray_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_volume_ray_comp.glsl @@ -15,7 +15,7 @@ #pragma BLENDER_REQUIRE(eevee_spherical_harmonics_lib.glsl) #pragma BLENDER_REQUIRE(eevee_surfel_list_lib.glsl) #pragma BLENDER_REQUIRE(eevee_lightprobe_lib.glsl) -#pragma BLENDER_REQUIRE(eevee_reflection_probe_lib.glsl) +#pragma BLENDER_REQUIRE(eevee_lightprobe_sphere_lib.glsl) void irradiance_capture(vec3 L, vec3 irradiance, float visibility, inout SphericalHarmonicL1 sh) { @@ -68,7 +68,7 @@ void irradiance_capture_world(vec3 L, inout SphericalHarmonicL1 sh) if (capture_info_buf.capture_world_direct) { SphereProbeUvArea atlas_coord = capture_info_buf.world_atlas_coord; - radiance = reflection_probes_sample(L, 0.0, atlas_coord).rgb; + radiance = lightprobe_spheres_sample(L, 0.0, atlas_coord).rgb; /* Clamped brightness. */ float luma = max(1e-8, reduce_max(radiance)); @@ -90,10 +90,9 @@ void main() return; } - vec3 P = lightprobe_irradiance_grid_sample_position( - capture_info_buf.irradiance_grid_local_to_world, - capture_info_buf.irradiance_grid_size, - grid_coord); + vec3 P = lightprobe_volume_grid_sample_position(capture_info_buf.irradiance_grid_local_to_world, + capture_info_buf.irradiance_grid_size, + grid_coord); /* Add virtual offset to avoid baking inside of geometry as much as possible. */ P += imageLoad(virtual_offset_img, grid_coord).xyz; diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_irradiance_world_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_volume_world_comp.glsl similarity index 100% rename from source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_irradiance_world_comp.glsl rename to source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_volume_world_comp.glsl diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_surf_world_frag.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_surf_world_frag.glsl index 8cc4d460d70..4419b27ae3a 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_surf_world_frag.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_surf_world_frag.glsl @@ -14,7 +14,7 @@ #pragma BLENDER_REQUIRE(eevee_nodetree_lib.glsl) #pragma BLENDER_REQUIRE(eevee_colorspace_lib.glsl) #pragma BLENDER_REQUIRE(eevee_sampling_lib.glsl) -#pragma BLENDER_REQUIRE(eevee_reflection_probe_lib.glsl) +#pragma BLENDER_REQUIRE(eevee_lightprobe_sphere_lib.glsl) #pragma BLENDER_REQUIRE(eevee_lightprobe_volume_eval_lib.glsl) vec4 closure_to_rgba(Closure cl) @@ -48,10 +48,10 @@ void main() float lod = max(1.0, base_lod); float mix_factor = min(1.0, base_lod); SphereProbeUvArea world_atlas_coord = reinterpret_as_atlas_coord(world_coord_packed); - vec4 probe_color = reflection_probes_sample(-g_data.N, lod, world_atlas_coord); + vec4 probe_color = lightprobe_spheres_sample(-g_data.N, lod, world_atlas_coord); out_background.rgb = mix(out_background.rgb, probe_color.rgb, mix_factor); - SphericalHarmonicL1 volume_irradiance = lightprobe_irradiance_sample( + SphericalHarmonicL1 volume_irradiance = lightprobe_volume_sample( g_data.P, vec3(0.0), g_data.Ng); vec3 radiance_sh = spherical_harmonics_evaluate_lambert(-g_data.N, volume_irradiance); float radiance_mix_factor = sphere_probe_roughness_to_mix_fac(world_background_blur); diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_surfel_ray_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_surfel_ray_comp.glsl index 71175ce37c5..797d6e3525e 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_surfel_ray_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_surfel_ray_comp.glsl @@ -15,7 +15,7 @@ #pragma BLENDER_REQUIRE(gpu_shader_utildefines_lib.glsl) #pragma BLENDER_REQUIRE(gpu_shader_math_base_lib.glsl) #pragma BLENDER_REQUIRE(gpu_shader_math_vector_lib.glsl) -#pragma BLENDER_REQUIRE(eevee_reflection_probe_lib.glsl) +#pragma BLENDER_REQUIRE(eevee_lightprobe_sphere_lib.glsl) float avg_albedo(vec3 albedo) { @@ -89,7 +89,7 @@ void radiance_transfer_world(inout Surfel receiver, vec3 L) if (capture_info_buf.capture_world_indirect) { SphereProbeUvArea atlas_coord = capture_info_buf.world_atlas_coord; - radiance = reflection_probes_sample(L, 0.0, atlas_coord).rgb; + radiance = lightprobe_spheres_sample(L, 0.0, atlas_coord).rgb; } if (capture_info_buf.capture_visibility_indirect) { diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_volume_scatter_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_volume_scatter_comp.glsl index 360e9aff141..04e7339c7e4 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_volume_scatter_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_volume_scatter_comp.glsl @@ -61,7 +61,7 @@ vec3 volume_light_eval(const bool is_directional, vec3 P, vec3 V, uint l_idx, fl vec3 volume_lightprobe_eval(vec3 P, vec3 V, float s_anisotropy) { SphericalHarmonicL1 phase_sh = volume_phase_function_as_sh_L1(V, s_anisotropy); - SphericalHarmonicL1 volume_radiance_sh = lightprobe_irradiance_sample(P); + SphericalHarmonicL1 volume_radiance_sh = lightprobe_volume_sample(P); float clamp_indirect = uniform_buf.clamp.volume_indirect; volume_radiance_sh = spherical_harmonics_clamp(volume_radiance_sh, clamp_indirect); diff --git a/source/blender/draw/engines/eevee_next/shaders/infos/eevee_reflection_probe_info.hh b/source/blender/draw/engines/eevee_next/shaders/infos/eevee_lightprobe_sphere_info.hh similarity index 80% rename from source/blender/draw/engines/eevee_next/shaders/infos/eevee_reflection_probe_info.hh rename to source/blender/draw/engines/eevee_next/shaders/infos/eevee_lightprobe_sphere_info.hh index 42dde156e9a..6b56f356ad4 100644 --- a/source/blender/draw/engines/eevee_next/shaders/infos/eevee_reflection_probe_info.hh +++ b/source/blender/draw/engines/eevee_next/shaders/infos/eevee_lightprobe_sphere_info.hh @@ -9,15 +9,15 @@ /** \name Shared * \{ */ -GPU_SHADER_CREATE_INFO(eevee_reflection_probe_data) +GPU_SHADER_CREATE_INFO(eevee_lightprobe_sphere_data) .define("SPHERE_PROBE") .uniform_buf(SPHERE_PROBE_BUF_SLOT, "SphereProbeData", - "reflection_probe_buf[SPHERE_PROBE_MAX]") - .sampler(SPHERE_PROBE_TEX_SLOT, ImageType::FLOAT_2D_ARRAY, "reflection_probes_tx"); + "lightprobe_sphere_buf[SPHERE_PROBE_MAX]") + .sampler(SPHERE_PROBE_TEX_SLOT, ImageType::FLOAT_2D_ARRAY, "lightprobe_spheres_tx"); /* Sample cubemap and remap into an octahedral texture. */ -GPU_SHADER_CREATE_INFO(eevee_reflection_probe_remap) +GPU_SHADER_CREATE_INFO(eevee_lightprobe_sphere_remap) .local_group_size(SPHERE_PROBE_REMAP_GROUP_SIZE, SPHERE_PROBE_REMAP_GROUP_SIZE) .specialization_constant(Type::BOOL, "extract_sh", true) .specialization_constant(Type::BOOL, "extract_sun", true) @@ -29,43 +29,43 @@ GPU_SHADER_CREATE_INFO(eevee_reflection_probe_remap) .storage_buf(0, Qualifier::WRITE, "SphereProbeHarmonic", "out_sh[SPHERE_PROBE_MAX_HARMONIC]") .storage_buf(1, Qualifier::WRITE, "SphereProbeSunLight", "out_sun[SPHERE_PROBE_MAX_HARMONIC]") .image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D_ARRAY, "atlas_img") - .compute_source("eevee_reflection_probe_remap_comp.glsl") + .compute_source("eevee_lightprobe_sphere_remap_comp.glsl") .additional_info("eevee_shared", "eevee_global_ubo") .do_static_compilation(true); -GPU_SHADER_CREATE_INFO(eevee_reflection_probe_irradiance) +GPU_SHADER_CREATE_INFO(eevee_lightprobe_sphere_irradiance) .local_group_size(SPHERE_PROBE_SH_GROUP_SIZE) .push_constant(Type::IVEC3, "probe_remap_dispatch_size") .storage_buf(0, Qualifier::READ, "SphereProbeHarmonic", "in_sh[SPHERE_PROBE_MAX_HARMONIC]") .storage_buf(1, Qualifier::WRITE, "SphereProbeHarmonic", "out_sh") .additional_info("eevee_shared") .do_static_compilation(true) - .compute_source("eevee_reflection_probe_irradiance_comp.glsl"); + .compute_source("eevee_lightprobe_sphere_irradiance_comp.glsl"); -GPU_SHADER_CREATE_INFO(eevee_reflection_probe_sunlight) +GPU_SHADER_CREATE_INFO(eevee_lightprobe_sphere_sunlight) .local_group_size(SPHERE_PROBE_SH_GROUP_SIZE) .push_constant(Type::IVEC3, "probe_remap_dispatch_size") .storage_buf(0, Qualifier::READ, "SphereProbeSunLight", "in_sun[SPHERE_PROBE_MAX_HARMONIC]") .storage_buf(1, Qualifier::WRITE, "LightData", "sunlight_buf") .additional_info("eevee_shared") .do_static_compilation(true) - .compute_source("eevee_reflection_probe_sunlight_comp.glsl"); + .compute_source("eevee_lightprobe_sphere_sunlight_comp.glsl"); -GPU_SHADER_CREATE_INFO(eevee_reflection_probe_select) +GPU_SHADER_CREATE_INFO(eevee_lightprobe_sphere_select) .local_group_size(SPHERE_PROBE_SELECT_GROUP_SIZE) .storage_buf(0, Qualifier::READ_WRITE, "SphereProbeData", - "reflection_probe_buf[SPHERE_PROBE_MAX]") - .push_constant(Type::INT, "reflection_probe_count") + "lightprobe_sphere_buf[SPHERE_PROBE_MAX]") + .push_constant(Type::INT, "lightprobe_sphere_count") .additional_info("eevee_shared", "eevee_sampling_data", "eevee_global_ubo", "eevee_volume_probe_data") - .compute_source("eevee_reflection_probe_select_comp.glsl") + .compute_source("eevee_lightprobe_sphere_select_comp.glsl") .do_static_compilation(true); -GPU_SHADER_CREATE_INFO(eevee_reflection_probe_convolve) +GPU_SHADER_CREATE_INFO(eevee_lightprobe_sphere_convolve) .local_group_size(SPHERE_PROBE_GROUP_SIZE, SPHERE_PROBE_GROUP_SIZE) .additional_info("eevee_shared") .push_constant(Type::IVEC4, "probe_coord_packed") @@ -75,7 +75,7 @@ GPU_SHADER_CREATE_INFO(eevee_reflection_probe_convolve) .sampler(0, ImageType::FLOAT_CUBE, "cubemap_tx") .sampler(1, ImageType::FLOAT_2D_ARRAY, "in_atlas_mip_tx") .image(1, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D_ARRAY, "out_atlas_mip_img") - .compute_source("eevee_reflection_probe_convolve_comp.glsl") + .compute_source("eevee_lightprobe_sphere_convolve_comp.glsl") .do_static_compilation(true); GPU_SHADER_INTERFACE_INFO(eevee_display_probe_reflection_iface, "") @@ -84,7 +84,7 @@ GPU_SHADER_INTERFACE_INFO(eevee_display_probe_reflection_iface, "") .flat(Type::INT, "probe_index"); GPU_SHADER_CREATE_INFO(eevee_display_probe_reflection) - .additional_info("eevee_shared", "draw_view", "eevee_reflection_probe_data") + .additional_info("eevee_shared", "draw_view", "eevee_lightprobe_sphere_data") .storage_buf(0, Qualifier::READ, "SphereProbeDisplayData", "display_data_buf[]") .vertex_source("eevee_display_probe_reflection_vert.glsl") .vertex_out(eevee_display_probe_reflection_iface) @@ -101,7 +101,7 @@ GPU_SHADER_CREATE_INFO(eevee_display_probe_planar) .additional_info("eevee_shared", "draw_view", "eevee_lightprobe_planar_data", - "eevee_reflection_probe_data") + "eevee_lightprobe_sphere_data") .storage_buf(0, Qualifier::READ, "PlanarProbeDisplayData", "display_data_buf[]") .vertex_source("eevee_display_probe_planar_vert.glsl") .vertex_out(eevee_display_probe_planar_iface) diff --git a/source/blender/draw/engines/eevee_next/shaders/infos/eevee_irradiance_cache_info.hh b/source/blender/draw/engines/eevee_next/shaders/infos/eevee_lightprobe_volume_info.hh similarity index 92% rename from source/blender/draw/engines/eevee_next/shaders/infos/eevee_irradiance_cache_info.hh rename to source/blender/draw/engines/eevee_next/shaders/infos/eevee_lightprobe_volume_info.hh index f61672dff57..f1df71b6b73 100644 --- a/source/blender/draw/engines/eevee_next/shaders/infos/eevee_irradiance_cache_info.hh +++ b/source/blender/draw/engines/eevee_next/shaders/infos/eevee_lightprobe_volume_info.hh @@ -114,14 +114,14 @@ GPU_SHADER_CREATE_INFO(eevee_surfel_ray) .local_group_size(SURFEL_GROUP_SIZE) .additional_info("eevee_shared", "eevee_surfel_common", - "eevee_reflection_probe_data", + "eevee_lightprobe_sphere_data", "draw_view") .push_constant(Type::INT, "radiance_src") .push_constant(Type::INT, "radiance_dst") .compute_source("eevee_surfel_ray_comp.glsl") .do_static_compilation(true); -GPU_SHADER_CREATE_INFO(eevee_lightprobe_irradiance_bounds) +GPU_SHADER_CREATE_INFO(eevee_lightprobe_volume_bounds) .do_static_compilation(true) .local_group_size(IRRADIANCE_BOUNDS_GROUP_SIZE) .storage_buf(0, Qualifier::READ_WRITE, "CaptureInfoData", "capture_info_buf") @@ -129,15 +129,15 @@ GPU_SHADER_CREATE_INFO(eevee_lightprobe_irradiance_bounds) .push_constant(Type::INT, "resource_len") .typedef_source("draw_shader_shared.hh") .additional_info("eevee_shared") - .compute_source("eevee_lightprobe_irradiance_bounds_comp.glsl"); + .compute_source("eevee_lightprobe_volume_bounds_comp.glsl"); -GPU_SHADER_CREATE_INFO(eevee_lightprobe_irradiance_ray) +GPU_SHADER_CREATE_INFO(eevee_lightprobe_volume_ray) .local_group_size(IRRADIANCE_GRID_GROUP_SIZE, IRRADIANCE_GRID_GROUP_SIZE, IRRADIANCE_GRID_GROUP_SIZE) .additional_info("eevee_shared", "eevee_surfel_common", - "eevee_reflection_probe_data", + "eevee_lightprobe_sphere_data", "draw_view") .push_constant(Type::INT, "radiance_src") .storage_buf(0, Qualifier::READ, "int", "list_start_buf[]") @@ -148,10 +148,10 @@ GPU_SHADER_CREATE_INFO(eevee_lightprobe_irradiance_ray) .image(3, GPU_RGBA32F, Qualifier::READ_WRITE, ImageType::FLOAT_3D, "irradiance_L1_c_img") .image(4, GPU_RGBA16F, Qualifier::READ, ImageType::FLOAT_3D, "virtual_offset_img") .image(5, GPU_R32F, Qualifier::READ_WRITE, ImageType::FLOAT_3D, "validity_img") - .compute_source("eevee_lightprobe_irradiance_ray_comp.glsl") + .compute_source("eevee_lightprobe_volume_ray_comp.glsl") .do_static_compilation(true); -GPU_SHADER_CREATE_INFO(eevee_lightprobe_irradiance_offset) +GPU_SHADER_CREATE_INFO(eevee_lightprobe_volume_offset) .local_group_size(IRRADIANCE_GRID_GROUP_SIZE, IRRADIANCE_GRID_GROUP_SIZE, IRRADIANCE_GRID_GROUP_SIZE) @@ -160,7 +160,7 @@ GPU_SHADER_CREATE_INFO(eevee_lightprobe_irradiance_offset) .storage_buf(6, Qualifier::READ, "SurfelListInfoData", "list_info_buf") .image(0, GPU_R32I, Qualifier::READ, ImageType::INT_3D_ATOMIC, "cluster_list_img") .image(1, GPU_RGBA16F, Qualifier::READ_WRITE, ImageType::FLOAT_3D, "virtual_offset_img") - .compute_source("eevee_lightprobe_irradiance_offset_comp.glsl") + .compute_source("eevee_lightprobe_volume_offset_comp.glsl") .do_static_compilation(true); /** \} */ @@ -169,7 +169,7 @@ GPU_SHADER_CREATE_INFO(eevee_lightprobe_irradiance_offset) /** \name Runtime * \{ */ -GPU_SHADER_CREATE_INFO(eevee_lightprobe_irradiance_world) +GPU_SHADER_CREATE_INFO(eevee_lightprobe_volume_world) .local_group_size(IRRADIANCE_GRID_BRICK_SIZE, IRRADIANCE_GRID_BRICK_SIZE, IRRADIANCE_GRID_BRICK_SIZE) @@ -181,10 +181,10 @@ GPU_SHADER_CREATE_INFO(eevee_lightprobe_irradiance_world) .uniform_buf(0, "VolumeProbeData", "grids_infos_buf[IRRADIANCE_GRID_MAX]") .image( 0, VOLUME_PROBE_FORMAT, Qualifier::READ_WRITE, ImageType::FLOAT_3D, "irradiance_atlas_img") - .compute_source("eevee_lightprobe_irradiance_world_comp.glsl") + .compute_source("eevee_lightprobe_volume_world_comp.glsl") .do_static_compilation(true); -GPU_SHADER_CREATE_INFO(eevee_lightprobe_irradiance_load) +GPU_SHADER_CREATE_INFO(eevee_lightprobe_volume_load) .local_group_size(IRRADIANCE_GRID_BRICK_SIZE, IRRADIANCE_GRID_BRICK_SIZE, IRRADIANCE_GRID_BRICK_SIZE) @@ -211,7 +211,7 @@ GPU_SHADER_CREATE_INFO(eevee_lightprobe_irradiance_load) .sampler(9, ImageType::FLOAT_3D, "validity_tx") .image( 0, VOLUME_PROBE_FORMAT, Qualifier::READ_WRITE, ImageType::FLOAT_3D, "irradiance_atlas_img") - .compute_source("eevee_lightprobe_irradiance_load_comp.glsl") + .compute_source("eevee_lightprobe_volume_load_comp.glsl") .do_static_compilation(true); GPU_SHADER_CREATE_INFO(eevee_volume_probe_data) @@ -225,7 +225,7 @@ GPU_SHADER_CREATE_INFO(eevee_volume_probe_data) .define("IRRADIANCE_GRID_SAMPLING"); GPU_SHADER_CREATE_INFO(eevee_lightprobe_data) - .additional_info("eevee_reflection_probe_data", "eevee_volume_probe_data"); + .additional_info("eevee_lightprobe_sphere_data", "eevee_volume_probe_data"); GPU_SHADER_CREATE_INFO(eevee_lightprobe_planar_data) .define("SPHERE_PROBE") diff --git a/source/blender/draw/engines/eevee_next/shaders/infos/eevee_material_info.hh b/source/blender/draw/engines/eevee_next/shaders/infos/eevee_material_info.hh index b2387f6836c..081484d2acd 100644 --- a/source/blender/draw/engines/eevee_next/shaders/infos/eevee_material_info.hh +++ b/source/blender/draw/engines/eevee_next/shaders/infos/eevee_material_info.hh @@ -220,7 +220,7 @@ GPU_SHADER_CREATE_INFO(eevee_surf_world) .fragment_out(0, Type::VEC4, "out_background") .fragment_source("eevee_surf_world_frag.glsl") .additional_info("eevee_global_ubo", - "eevee_reflection_probe_data", + "eevee_lightprobe_sphere_data", "eevee_volume_probe_data", "eevee_sampling_data", /* Optionally added depending on the material. */ diff --git a/source/blender/gpu/CMakeLists.txt b/source/blender/gpu/CMakeLists.txt index f7eece60664..c54bb6435df 100644 --- a/source/blender/gpu/CMakeLists.txt +++ b/source/blender/gpu/CMakeLists.txt @@ -713,13 +713,13 @@ set(SRC_SHADER_CREATE_INFOS ../draw/engines/eevee_next/shaders/infos/eevee_depth_of_field_info.hh ../draw/engines/eevee_next/shaders/infos/eevee_film_info.hh ../draw/engines/eevee_next/shaders/infos/eevee_hiz_info.hh - ../draw/engines/eevee_next/shaders/infos/eevee_irradiance_cache_info.hh ../draw/engines/eevee_next/shaders/infos/eevee_light_culling_info.hh + ../draw/engines/eevee_next/shaders/infos/eevee_lightprobe_volume_info.hh + ../draw/engines/eevee_next/shaders/infos/eevee_lightprobe_sphere_info.hh ../draw/engines/eevee_next/shaders/infos/eevee_lookdev_info.hh ../draw/engines/eevee_next/shaders/infos/eevee_lut_info.hh ../draw/engines/eevee_next/shaders/infos/eevee_material_info.hh ../draw/engines/eevee_next/shaders/infos/eevee_motion_blur_info.hh - ../draw/engines/eevee_next/shaders/infos/eevee_reflection_probe_info.hh ../draw/engines/eevee_next/shaders/infos/eevee_shadow_info.hh ../draw/engines/eevee_next/shaders/infos/eevee_subsurface_info.hh ../draw/engines/eevee_next/shaders/infos/eevee_tracing_info.hh