|
Blender V5.0
|
#include <eevee_lightprobe_volume.hh>
Public Member Functions | |
| IrradianceBake (Instance &inst) | |
| bool | should_break () |
Baking | |
| void | init (const Object &probe_object) |
| void | sync () |
| void | surfel_raster_views_sync (const float3 &scene_min, const float3 &scene_max, const float4x4 &probe_to_world) |
| void | surfels_create (const Object &probe_object) |
| void | surfels_lights_eval () |
| void | clusters_build () |
| void | raylists_build () |
| void | propagate_light () |
| void | irradiance_offset () |
| void | irradiance_capture () |
| LightProbeGridCacheFrame * | read_result_unpacked () |
| LightProbeGridCacheFrame * | read_result_packed () |
Baking related pass and data. Not used at runtime.
Definition at line 37 of file eevee_lightprobe_volume.hh.
|
inline |
Definition at line 151 of file eevee_lightprobe_volume.hh.
| void blender::eevee::IrradianceBake::clusters_build | ( | ) |
Create a surfel lists per irradiance probe in order to compute the virtual baking offset. NOTE: The resulting lists are only valid until clusters_build() or raylists_build() are called since they share the same links inside the Surfel struct.
Definition at line 1244 of file eevee_lightprobe_volume.cc.
References clusters_build(), GPU_TEXTURE_USAGE_ATOMIC, GPU_TEXTURE_USAGE_SHADER_READ, and GPU_TEXTURE_USAGE_SHADER_WRITE.
Referenced by clusters_build().
| void blender::eevee::IrradianceBake::init | ( | const Object & | probe_object | ) |
Definition at line 745 of file eevee_lightprobe_volume.cc.
References DRW_object_get_data_for_drawing(), blender::MatBase< float, 4, 4 >::identity(), init(), LIGHTPROBE_GRID_CAPTURE_EMISSION, LIGHTPROBE_GRID_CAPTURE_INDIRECT, LIGHTPROBE_GRID_CAPTURE_WORLD, blender::math::reduce_max(), surfel_raster_views_sync(), and blender::math::to_scale().
Referenced by init().
| void blender::eevee::IrradianceBake::irradiance_capture | ( | ) |
Store surfel irradiance inside the irradiance grid samples.
Definition at line 1358 of file eevee_lightprobe_volume.cc.
References irradiance_capture().
Referenced by irradiance_capture().
| void blender::eevee::IrradianceBake::irradiance_offset | ( | ) |
Compute offset to bias irradiance capture location.
Definition at line 1259 of file eevee_lightprobe_volume.cc.
References irradiance_offset().
Referenced by irradiance_offset().
| void blender::eevee::IrradianceBake::propagate_light | ( | ) |
Propagate light from surfel to surfel in a random direction over the sphere.
Definition at line 1346 of file eevee_lightprobe_volume.cc.
References propagate_light().
Referenced by propagate_light().
| void blender::eevee::IrradianceBake::raylists_build | ( | ) |
Create a surfel lists to emulate ray-casts for the current sample random direction. NOTE: The resulting lists are only valid until clusters_build() or raylists_build() are called since they share the same links inside the Surfel struct.
Definition at line 1272 of file eevee_lightprobe_volume.cc.
References ceil_to_multiple_u(), cross, divide_ceil_u(), e, blender::math::from_orthonormal_axes(), GPU_storagebuf_clear(), invert(), M_SQRT1_2, blender::math::max(), max_ii(), blender::math::min(), normalize, blender::math::orthogonal(), blender::math::projection::orthographic(), raylists_build(), blender::eevee::Sampling::sample_sphere(), blender::eevee::SAMPLING_FILTER_U, blender::eevee::SAMPLING_LENS_U, SURFEL_LIST_GROUP_SIZE, transform_point(), and blender::VecBase< T, Size >::xy().
Referenced by raylists_build().
| LightProbeGridCacheFrame * blender::eevee::IrradianceBake::read_result_packed | ( | ) |
Read grid packed irradiance back to CPU and returns as a LightProbeGridCacheFrame.
Definition at line 1420 of file eevee_lightprobe_volume.cc.
References LightProbeGridCacheFrame::baking, BKE_lightprobe_grid_cache_frame_create(), LightProbeGridCacheFrame::connectivity, copy_v3_v3(), float, GPU_BARRIER_TEXTURE_UPDATE, GPU_DATA_FLOAT, GPU_memory_barrier(), i, LightProbeGridCacheFrame::irradiance, LightProbeBakingData::L0, LightProbeIrradianceData::L0, LightProbeVisibilityData::L0, LightProbeBakingData::L1_a, LightProbeIrradianceData::L1_a, LightProbeVisibilityData::L1_a, LightProbeBakingData::L1_b, LightProbeIrradianceData::L1_b, LightProbeVisibilityData::L1_b, LightProbeBakingData::L1_c, LightProbeIrradianceData::L1_c, LightProbeVisibilityData::L1_c, MEM_mallocN(), MEM_SAFE_FREE, read_result_packed(), LightProbeGridCacheFrame::size, unit_float_to_uchar_clamp(), LightProbeBakingData::validity, LightProbeConnectivityData::validity, and LightProbeGridCacheFrame::visibility.
Referenced by read_result_packed().
| LightProbeGridCacheFrame * blender::eevee::IrradianceBake::read_result_unpacked | ( | ) |
Read grid unpacked irradiance back to CPU and returns as a LightProbeGridCacheFrame.
Definition at line 1398 of file eevee_lightprobe_volume.cc.
References LightProbeGridCacheFrame::baking, BKE_lightprobe_grid_cache_frame_create(), float, GPU_BARRIER_TEXTURE_UPDATE, GPU_DATA_FLOAT, GPU_memory_barrier(), LightProbeBakingData::L0, LightProbeBakingData::L1_a, LightProbeBakingData::L1_b, LightProbeBakingData::L1_c, read_result_unpacked(), LightProbeGridCacheFrame::size, and LightProbeBakingData::validity.
Referenced by read_result_unpacked().
|
inline |
True if the bake job should stop.
Definition at line 157 of file eevee_lightprobe_volume.hh.
| void blender::eevee::IrradianceBake::surfel_raster_views_sync | ( | const float3 & | scene_min, |
| const float3 & | scene_max, | ||
| const float4x4 & | probe_to_world ) |
Create the views used to rasterize the scene into surfel representation.
Definition at line 911 of file eevee_lightprobe_volume.cc.
References distance(), FLT_MAX, blender::math::from_loc_rot_scale(), blender::math::from_rotation(), invert(), max, blender::math::midpoint(), min, blender::math::projection::orthographic(), blender::math::scale(), surfel_raster_views_sync(), blender::math::to_loc_rot_scale(), transform_point(), view, x, y, and z().
Referenced by init(), surfel_raster_views_sync(), and surfels_create().
| void blender::eevee::IrradianceBake::surfels_create | ( | const Object & | probe_object | ) |
Create a surfel representation of the scene from the probe using the capture pipeline.
We rasterize the scene along the 3 axes. Each generated fragment will write a surface element so raster grid density need to match the desired surfel density. We do a first pass to know how much surfel to allocate then render again to create the surfels.
Definition at line 973 of file eevee_lightprobe_volume.cc.
References blender::math::abs(), blender::eevee::SphereProbeData::atlas_coord, blender::draw::detail::PassBase< DrawCommandBufType >::bind_ssbo(), blender::draw::Manager::bounds_buf, CLOG_INFO, blender::draw::detail::PassBase< DrawCommandBufType >::dispatch(), blender::math::divide_ceil(), divide_ceil_u(), DRW_object_get_data_for_drawing(), G, GPU_BARRIER_BUFFER_UPDATE, GPU_BARRIER_SHADER_STORAGE, GPU_debug_group_begin(), GPU_debug_group_end(), GPU_max_storage_buffer_size(), GPU_mem_stats_get(), GPU_mem_stats_supported(), GPU_memory_barrier(), GPU_TEXTURE_USAGE_HOST_READ, GPU_TEXTURE_USAGE_SHADER_READ, GPU_TEXTURE_USAGE_SHADER_WRITE, Object::id, blender::draw::detail::Pass< DrawCommandBufType >::init(), invert(), IRRADIANCE_BOUNDS_GROUP_SIZE, IRRADIANCE_GRID_GROUP_SIZE, blender::eevee::LIGHTPROBE_IRRADIANCE_BOUNDS, blender::eevee::Instance::log, min, ID::name, normalize, blender::draw::detail::PassBase< DrawCommandBufType >::push_constant(), blender::math::reduce_min(), blender::draw::Manager::resource_handle_count(), blender::draw::detail::PassBase< DrawCommandBufType >::shader_set(), SURFEL_GROUP_SIZE, surfel_raster_views_sync(), surfels_create(), blender::math::to_scale(), transform_point(), and xy.
Referenced by surfels_create().
| void blender::eevee::IrradianceBake::surfels_lights_eval | ( | ) |
Evaluate direct lighting (and also clear the surfels radiance).
Definition at line 1225 of file eevee_lightprobe_volume.cc.
References GPU_DEVICE_ANY, GPU_DRIVER_ANY, GPU_finish(), GPU_OS_MAC, GPU_type_matches(), and surfels_lights_eval().
Referenced by surfels_lights_eval().
| void blender::eevee::IrradianceBake::sync | ( | ) |
Definition at line 762 of file eevee_lightprobe_volume.cc.
References blender::draw::detail::PassBase< DrawCommandBufType >::barrier(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_image(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_resources(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_ssbo(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_texture(), CAPTURE_BUF_SLOT, blender::draw::detail::PassBase< DrawCommandBufType >::dispatch(), GPU_BARRIER_SHADER_IMAGE_ACCESS, GPU_BARRIER_SHADER_STORAGE, GPU_BARRIER_TEXTURE_FETCH, blender::draw::detail::Pass< DrawCommandBufType >::init(), blender::eevee::LIGHTPROBE_IRRADIANCE_OFFSET, blender::eevee::LIGHTPROBE_IRRADIANCE_RAY, blender::draw::detail::PassBase< DrawCommandBufType >::push_constant(), RBUFS_UTILITY_TEX_SLOT, blender::draw::detail::PassBase< DrawCommandBufType >::shader_set(), blender::draw::detail::PassBase< DrawCommandBufType >::sub(), SURFEL_BUF_SLOT, blender::eevee::SURFEL_CLUSTER_BUILD, blender::eevee::SURFEL_LIGHT, blender::eevee::SURFEL_LIST_BUILD, blender::eevee::SURFEL_LIST_FLATTEN, blender::eevee::SURFEL_LIST_PREFIX, blender::eevee::SURFEL_LIST_PREPARE, blender::eevee::SURFEL_LIST_SORT, blender::eevee::SURFEL_RAY, and sync().
Referenced by sync().