|
Blender V5.3
|
#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 152 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 1262 of file eevee_lightprobe_volume.cc.
References blender::GPU_TEXTURE_USAGE_ATOMIC, blender::GPU_TEXTURE_USAGE_SHADER_READ, and blender::GPU_TEXTURE_USAGE_SHADER_WRITE.
Referenced by blender::eevee::Instance::light_bake_irradiance().
| void blender::eevee::IrradianceBake::init | ( | const Object & | probe_object | ) |
Definition at line 759 of file eevee_lightprobe_volume.cc.
References blender::DRW_object_get_data_for_drawing(), blender::MatBase< float, 4, 4 >::identity(), blender::LIGHTPROBE_GRID_CAPTURE_EMISSION, blender::LIGHTPROBE_GRID_CAPTURE_INDIRECT, blender::LIGHTPROBE_GRID_CAPTURE_WORLD, blender::math::reduce_max(), surfel_raster_views_sync(), and blender::math::to_scale().
Referenced by blender::eevee::Instance::light_bake_irradiance().
| void blender::eevee::IrradianceBake::irradiance_capture | ( | ) |
Store surfel irradiance inside the irradiance grid samples.
Definition at line 1376 of file eevee_lightprobe_volume.cc.
Referenced by blender::eevee::Instance::light_bake_irradiance().
| void blender::eevee::IrradianceBake::irradiance_offset | ( | ) |
Compute offset to bias irradiance capture location.
Definition at line 1277 of file eevee_lightprobe_volume.cc.
Referenced by blender::eevee::Instance::light_bake_irradiance().
| void blender::eevee::IrradianceBake::propagate_light | ( | ) |
Propagate light from surfel to surfel in a random direction over the sphere.
Definition at line 1364 of file eevee_lightprobe_volume.cc.
Referenced by blender::eevee::Instance::light_bake_irradiance().
| 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 1290 of file eevee_lightprobe_volume.cc.
References blender::ceil_to_multiple_u(), cross, blender::divide_ceil_u(), blender::e, blender::math::from_orthonormal_axes(), blender::GPU_storagebuf_clear(), invert(), M_SQRT1_2, blender::math::max(), max, blender::max_ii(), min, normalize, orthogonal(), blender::math::projection::orthographic(), blender::eevee::Sampling::sample_sphere(), blender::eevee::SAMPLING_FILTER_U, blender::eevee::SAMPLING_LENS_U, SURFEL_LIST_GROUP_SIZE, and transform_point().
Referenced by blender::eevee::Instance::light_bake_irradiance().
| LightProbeGridCacheFrame * blender::eevee::IrradianceBake::read_result_packed | ( | ) |
Read grid packed irradiance back to CPU and returns as a LightProbeGridCacheFrame.
Definition at line 1443 of file eevee_lightprobe_volume.cc.
References blender::LightProbeGridCacheFrame::baking, blender::BKE_lightprobe_grid_cache_frame_create(), blender::LightProbeGridCacheFrame::connectivity, blender::copy_v3_v3(), blender::GPU_BARRIER_TEXTURE_UPDATE, blender::GPU_DATA_FLOAT, blender::GPU_memory_barrier(), blender::IndexRange::IndexRange(), blender::LightProbeGridCacheFrame::irradiance, blender::LightProbeBakingData::L0, blender::LightProbeIrradianceData::L0, blender::LightProbeVisibilityData::L0, blender::LightProbeBakingData::L1_a, blender::LightProbeIrradianceData::L1_a, blender::LightProbeVisibilityData::L1_a, blender::LightProbeBakingData::L1_b, blender::LightProbeIrradianceData::L1_b, blender::LightProbeVisibilityData::L1_b, blender::LightProbeBakingData::L1_c, blender::LightProbeIrradianceData::L1_c, blender::LightProbeVisibilityData::L1_c, blender::MEM_new_array_uninitialized(), blender::LightProbeGridCacheFrame::size, blender::unit_float_to_uchar_clamp(), blender::LightProbeBakingData::validity, blender::LightProbeConnectivityData::validity, and blender::LightProbeGridCacheFrame::visibility.
Referenced by blender::eevee::Instance::light_bake_irradiance().
| LightProbeGridCacheFrame * blender::eevee::IrradianceBake::read_result_unpacked | ( | ) |
Read grid unpacked irradiance back to CPU and returns as a LightProbeGridCacheFrame.
Definition at line 1417 of file eevee_lightprobe_volume.cc.
References blender::LightProbeGridCacheFrame::baking, blender::BKE_lightprobe_grid_cache_frame_create(), blender::GPU_BARRIER_TEXTURE_UPDATE, blender::GPU_DATA_FLOAT, blender::GPU_memory_barrier(), blender::LightProbeBakingData::L0, blender::LightProbeBakingData::L1_a, blender::LightProbeBakingData::L1_b, blender::LightProbeBakingData::L1_c, blender::LightProbeGridCacheFrame::size, and blender::LightProbeBakingData::validity.
Referenced by blender::eevee::Instance::light_bake_irradiance().
|
inline |
True if the bake job should stop.
Definition at line 158 of file eevee_lightprobe_volume.hh.
Referenced by blender::eevee::Instance::light_bake_irradiance().
| 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 926 of file eevee_lightprobe_volume.cc.
References distance(), FLT_MAX, from_loc_rot_scale(), from_rotation(), invert(), max, midpoint(), min, blender::math::projection::orthographic(), scale(), blender::draw::View::sync(), to_loc_rot_scale(), transform_point(), blender::draw::View::visibility_test(), blender::x, y, and z().
Referenced by init(), 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 988 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(), blender::divide_ceil_u(), blender::DRW_object_get_data_for_drawing(), blender::G, blender::GPU_BARRIER_BUFFER_UPDATE, blender::GPU_BARRIER_SHADER_STORAGE, blender::GPU_debug_group_begin(), blender::GPU_debug_group_end(), blender::GPU_max_storage_buffer_size(), blender::GPU_mem_stats_get(), blender::GPU_mem_stats_supported(), blender::GPU_memory_barrier(), blender::GPU_TEXTURE_USAGE_HOST_READ, blender::GPU_TEXTURE_USAGE_SHADER_READ, blender::GPU_TEXTURE_USAGE_SHADER_WRITE, blender::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, blender::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(), blender::math::to_scale(), and transform_point().
Referenced by blender::eevee::Instance::light_bake_irradiance().
| void blender::eevee::IrradianceBake::surfels_lights_eval | ( | ) |
Evaluate direct lighting (and also clear the surfels radiance).
Definition at line 1241 of file eevee_lightprobe_volume.cc.
References blender::GPU_DEVICE_ANY, blender::GPU_DRIVER_ANY, blender::GPU_finish(), blender::GPU_OS_MAC, and blender::GPU_type_matches().
Referenced by blender::eevee::Instance::light_bake_irradiance().
| void blender::eevee::IrradianceBake::sync | ( | ) |
Definition at line 777 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(), blender::GPU_BARRIER_SHADER_IMAGE_ACCESS, blender::GPU_BARRIER_SHADER_STORAGE, blender::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, and blender::eevee::SURFEL_RAY.
Referenced by blender::eevee::VolumeProbeModule::sync().