|
Blender V4.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 32 of file eevee_lightprobe_volume.hh.
|
inline |
Definition at line 137 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 1138 of file eevee_lightprobe_volume.cc.
References GPU_R32I, GPU_TEXTURE_USAGE_ATOMIC, GPU_TEXTURE_USAGE_SHADER_READ, and 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 697 of file eevee_lightprobe_volume.cc.
References Object::data, blender::MatBase< float, 4, 4 >::identity(), LIGHTPROBE_GRID_CAPTURE_EMISSION, LIGHTPROBE_GRID_CAPTURE_INDIRECT, LIGHTPROBE_GRID_CAPTURE_WORLD, blender::math::reduce_max(), 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 1242 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 1152 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 1230 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 1165 of file eevee_lightprobe_volume.cc.
References ceil_to_multiple_u(), cross(), divide_ceil_u(), e, GPU_storagebuf_clear(), invert(), M_SQRT1_2, blender::math::max(), max, min, normalize(), SURFEL_LIST_GROUP_SIZE, transform_point(), and blender::VecBase< T, Size >::xy().
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 1304 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(), 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, LightProbeGridCacheFrame::size, unit_float_to_uchar_clamp, LightProbeBakingData::validity, LightProbeConnectivityData::validity, and 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 1282 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, LightProbeGridCacheFrame::size, and LightProbeBakingData::validity.
Referenced by blender::eevee::Instance::light_bake_irradiance().
|
inline |
True if the bake job should stop.
Definition at line 143 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 817 of file eevee_lightprobe_volume.cc.
References distance(), FLT_MAX, invert(), max, blender::math::midpoint(), min, blender::math::to_loc_rot_scale(), transform_point(), view, and z().
| 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 879 of file eevee_lightprobe_volume.cc.
References blender::math::abs(), blender::eevee::SphereProbeData::atlas_coord, blender::draw::Manager::bounds_buf, Object::data, blender::math::divide_ceil(), divide_ceil_u(), DRW_stats_group_end(), DRW_stats_group_start(), G, GPU_BARRIER_BUFFER_UPDATE, GPU_BARRIER_SHADER_STORAGE, GPU_max_storage_buffer_size(), GPU_mem_stats_get(), GPU_mem_stats_supported(), GPU_memory_barrier(), GPU_R32F, GPU_RGBA16F, GPU_RGBA32F, GPU_TEXTURE_USAGE_HOST_READ, GPU_TEXTURE_USAGE_SHADER_READ, GPU_TEXTURE_USAGE_SHADER_WRITE, Object::id, blender::draw::detail::Pass< DrawCommandBufType >::init(), int, invert(), IRRADIANCE_BOUNDS_GROUP_SIZE, IRRADIANCE_GRID_GROUP_SIZE, blender::eevee::LIGHTPROBE_IRRADIANCE_BOUNDS, min, ID::name, normalize(), printf, blender::math::reduce_min(), blender::draw::Manager::resource_handle_count(), Surfel, SURFEL_GROUP_SIZE, blender::math::to_scale(), transform_point(), and xy.
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 1125 of file eevee_lightprobe_volume.cc.
Referenced by blender::eevee::Instance::light_bake_irradiance().
| void blender::eevee::IrradianceBake::sync | ( | ) |
Definition at line 714 of file eevee_lightprobe_volume.cc.
References blender::draw::detail::PassBase< DrawCommandBufType >::barrier(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_resources(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_ssbo(), 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_SORT, and blender::eevee::SURFEL_RAY.