50 float2 lP = pos[vert_id % 6];
52 v_out.display_index = vert_id / 6;
53 v_out.probe_index = srt.display_data_buf[v_out.display_index].probe_index;
55 float4x4 plane_to_world = srt.display_data_buf[v_out.display_index].plane_to_world;
58 out_position = views.get(0).point_world_to_homogenous(
P);
60 out_position.z -= 0.0001f;
73 float4x4 plane_to_world = srt.display_data_buf[v_out.display_index].plane_to_world;
82 textureLod(planes.planar_depth_tx,
float3(planar_uv, v_out.probe_index), 0.0f).r);
90 frag_out.color = spheres.sample_probe(
R, 0.0f, world_atlas_coord);
94 planes.planar_radiance_tx,
float3(planar_uv, v_out.probe_index), 0.0f);
96 frag_out.color.a = 0.0f;
143 v_out.lP = pos[vert_id % 6];
144 int cell_index = vert_id / 6;
146 int3 grid_res = srt.grid_resolution;
148 v_out.cell =
int3(cell_index / (grid_res.
z * grid_res.
y),
149 (cell_index / grid_res.
z) % grid_res.
y,
150 cell_index % grid_res.
z);
153 srt.grid_to_world, grid_res, v_out.cell);
155 float sphere_radius_final = srt.sphere_radius;
156 if (srt.display_validity) {
157 float validity =
texelFetch(srt.validity_tx, v_out.cell, 0).r;
158 sphere_radius_final *=
mix(1.0f, 0.1f, validity);
163 float3 vs_offset =
float3(v_out.lP, 0.0f) * sphere_radius_final;
168 out_position.
z += 0.0001f;
181 if (dist_squared > 1.0f) {
187 sh.
L0.M0 =
texelFetch(srt.irradiance_a_tx, v_out.cell, 0);
188 sh.
L1.Mn1 =
texelFetch(srt.irradiance_b_tx, v_out.cell, 0);
189 sh.
L1.M0 =
texelFetch(srt.irradiance_c_tx, v_out.cell, 0);
190 sh.
L1.Mp1 =
texelFetch(srt.irradiance_d_tx, v_out.cell, 0);
191 float validity =
texelFetch(srt.validity_tx, v_out.cell, 0).r;
194 float3 N = views.get(0).normal_view_to_world(vN);
199 if (srt.display_validity) {
204 frag_out.color =
float4(irradiance, 0.0f);
246 v_out.lP = pos[vert_id % 6];
247 int display_index = vert_id / 6;
249 v_out.probe_index = srt.display_data_buf[display_index].probe_index;
250 float sphere_radius = srt.display_data_buf[display_index].display_size;
252 float3 ws_probe_pos = spheres.lightprobe_sphere_buf[v_out.probe_index].location;
256 float3 vs_offset =
float3(v_out.lP, 0.0f) * sphere_radius;
262 out_position.
z += 0.0001f;
276 if (dist_squared > 1.0f) {
284 float3 N = view.normal_view_to_world(vN);
288 frag_out.color = spheres.sample_probe(
289 L, 0, spheres.lightprobe_sphere_buf[v_out.probe_index].atlas_coord);
290 frag_out.color.a = 0.0f;
PipelineGraphic eevee_display_lightprobe_planar(eevee::lightprobe::planar::display::vert_main, eevee::lightprobe::planar::display::frag_main)
PipelineGraphic eevee_display_lightprobe_volume(eevee::lightprobe::volume::display::vert_main, eevee::lightprobe::volume::display::frag_main)
PipelineGraphic eevee_display_lightprobe_sphere(eevee::lightprobe::sphere::display::vert_main, eevee::lightprobe::sphere::display::frag_main)
#define storage(slot, qualifiers)
void gpu_discard_fragment()
VecBase< T, D > reflect(VecOp< T, D >, VecOp< T, D >) RET
TEX_TEMPLATE DataVec texelFetch(T, IntCoord, int) RET
TEX_TEMPLATE DataVec textureLod(T, FltCoord, float) RET
SamplerBase< float, 3 > sampler3D
TEX_TEMPLATE SizeVec textureSize(T, int) RET
float length_squared(VecT a)
VecT safe_normalize(VecT vector)
MatBase< float, 4, 4 > float4x4
void vert_main(const Resources &srt, const draw::View &views, const int vert_id, float4 &out_position, VertOut &v_out)
void frag_main(const Resources &srt, const draw::View &views, const LightprobeSphereRenderData &spheres, const LightprobePlaneRenderData &planes, const float4 frag_co, const VertOut &v_out, FragOut &frag_out)
void frag_main(const Resources &, const draw::View &views, const LightprobeSphereRenderData &spheres, const VertOut &v_out, FragOut &frag_out)
void vert_main(const Resources &srt, const draw::View &views, const LightprobeSphereRenderData &spheres, const int vert_id, float4 &out_position, VertOut &v_out)
void vert_main(const Resources &srt, const draw::View &views, const int vert_id, float4 &out_position, VertOut &v_out)
void frag_main(const Resources &srt, const draw::View &views, const VertOut &v_out, FragOut &frag_out)
float3 grid_sample_position(float4x4 grid_local_to_world_mat, int3 grid_res, int3 cell_coord)
SphereProbeUvArea reinterpret_as_atlas_coord(int4 packed_coord)
T read(T depth_buffer_value)
float4 transform(float4 hs_position)
T evaluate_lambert(float3 N) const
spherical_harmonics::BandL1< T > L1
spherical_harmonics::BandL0< T > L0
float3 point_world_to_view(float3 P) const
float4 point_view_to_homogenous(float3 vP) const
float3 point_ndc_to_world(float3 ssP) const
T screen_to_ndc(T ss_P) const
float3 point_view_to_world(float3 vP) const
float3 world_incident_vector(float3 P) const
PlanarProbeDisplayData(& display_data_buf)[]
LightprobeSphereRenderData lightprobe_sphere
SphereProbeDisplayData(& display_data_buf)[]
sampler3D irradiance_b_tx
sampler3D irradiance_a_tx
sampler3D irradiance_d_tx
sampler3D irradiance_c_tx
CCL_NAMESPACE_BEGIN struct Window V