26 friend LightProbeModule;
37 Texture probes_tx_ = {
"Probes"};
40 PassSimple remap_ps_ = {
"Probe.CubemapToOctahedral"};
42 PassSimple sum_sh_ps_ = {
"Probe.SumSphericalHarmonics"};
44 PassSimple sum_sun_ps_ = {
"Probe.SumSunlight"};
50 GPUTexture *convolve_input_ =
nullptr;
52 GPUTexture *convolve_output_ =
nullptr;
53 int convolve_lod_ = 0;
55 bool extract_sh_ =
false;
58 int3 dispatch_probe_convolve_ =
int3(1);
59 int3 dispatch_probe_select_ =
int3(1);
66 Texture cubemap_tx_ = {
"Probe.Cubemap"};
70 SphereProbeUvArea probe_sampling_coord_;
71 SphereProbePixelArea probe_write_coord_;
73 SphereProbePixelArea probe_read_coord_;
75 SphereProbeUvArea world_sampling_coord_;
77 int lightprobe_sphere_count_ = 0;
80 StorageArrayBuffer<SphereProbeHarmonic, SPHERE_PROBE_MAX_HARMONIC, true>
81 tmp_spherical_harmonics_ = {
"tmp_spherical_harmonics_"};
83 StorageBuffer<SphereProbeHarmonic, true> spherical_harmonics_ = {
"spherical_harmonics_"};
86 StorageArrayBuffer<SphereProbeSunLight, SPHERE_PROBE_MAX_HARMONIC, true> tmp_sunlight_ = {
96 bool update_probes_next_sample_ =
false;
98 bool update_probes_this_sample_ =
false;
100 bool do_world_irradiance_update =
true;
103 bool do_display_draw_ =
false;
105 PassSimple viewport_display_ps_ = {
"ProbeSphereModule.Viewport Display"};
137 return spherical_harmonics_;
157 void ensure_cubemap_render_target(
int resolution);
162 int cube_target_extent;
164 float2 clipping_distances;
166 SphereProbeAtlasCoord atlas_coord;
171 UpdateInfo update_info_from_probe(SphereProbe &probe);
176 std::optional<UpdateInfo> world_update_info_pop();
177 std::optional<UpdateInfo> probe_update_info_pop();
185 void remap_to_octahedral_projection(
const SphereProbeAtlasCoord &atlas_coord,
186 bool extract_spherical_harmonics);