Blender V5.3
eevee::surfel Namespace Reference

Namespaces

namespace  list

Classes

struct  EvalLight
struct  Resources
struct  SurfelRay

Functions

void build_cluster (Resources &srt, SurfelData &surfels, const uint3 global_id)
void eval_light (EvalLight &, LightEvalIterator &lights, const Uniform &uni, const UtilityTexture &util_tx, SurfelData &surfels, const uint3 global_id)
int list_index_get (const ViewMatrices view, int2 ray_grid_size, float3 P, float &r_ray_distance)
int3 cluster_index_get (int3 cluster_grid_size, float4x4 irradiance_grid_world_to_local, float3 P)
float avg_albedo (float3 albedo)
void ray_main (SurfelRay &srt, const draw::View &views, const uint3 global_id)

Detailed Description

Apply lights contribution to scene surfel representation.

Function Documentation

◆ avg_albedo()

float eevee::surfel::avg_albedo ( float3 albedo)

Definition at line 14 of file eevee_surfel_ray.bsl.hh.

References avg_albedo(), dot(), and saturate.

Referenced by avg_albedo(), and eevee::surfel::SurfelRay::radiance_transfer().

◆ build_cluster()

void eevee::surfel::build_cluster ( Resources & srt,
SurfelData & surfels,
const uint3 global_id )

Takes scene surfel representation and build list of surfels inside 3D cells.

The lists head are allocated to fit the probe samples granularity.

Dispatch 1 thread per surfel.

Definition at line 23 of file eevee_surfel_cluster.bsl.hh.

References build_cluster(), cluster_index_get(), global_invocation_id, imageAtomicExchange(), imageSize(), resource_table, int3::x, int3::y, and int3::z.

Referenced by build_cluster().

◆ cluster_index_get()

int3 eevee::surfel::cluster_index_get ( int3 cluster_grid_size,
float4x4 irradiance_grid_world_to_local,
float3 P )

Return the corresponding cluster index in the cluster_list_tx for a given world position. It will clamp any coordinate outside valid bounds to nearest cluster.

Definition at line 34 of file eevee_surfel_list.bsl.hh.

References clamp(), cluster_index_get(), P, and transform_point().

Referenced by build_cluster(), and cluster_index_get().

◆ eval_light()

◆ list_index_get()

int eevee::surfel::list_index_get ( const ViewMatrices view,
int2 ray_grid_size,
float3 P,
float & r_ray_distance )

Return the corresponding list index in the list_start_buf for a given world position. It will clamp any coordinate outside valid bounds to nearest list. Also return the surfel sorting value as r_ray_distance.

Definition at line 19 of file eevee_surfel_list.bsl.hh.

References clamp(), list_index_get(), P, ViewMatrices::point_world_to_screen(), int2::x, int2::y, and float3::z.

Referenced by list_index_get(), eevee::surfel::list::prepare::prepare_comp(), and eevee::lightprobe::volume::ray_capture().

◆ ray_main()

void eevee::surfel::ray_main ( SurfelRay & srt,
const draw::View & views,
const uint3 global_id )

For every surfel, compute the incoming radiance from both side. For that, walk the ray surfel linked-list and gather the light from the neighbor surfels. This shader is dispatched for a random ray in a uniform hemisphere as we evaluate the radiance in both directions.

Dispatched as 1 thread per surfel.

Definition at line 113 of file eevee_surfel_ray.bsl.hh.

References SurfelData::capture_info_buf, global_invocation_id, ray_main(), resource_table, SurfelData::surfel_buf, and ViewMatrices::world_incident_vector().

Referenced by ray_main().