34 friend LightProbeModule;
45 Texture probes_tx_ = {
"Probes"};
48 PassSimple remap_ps_ = {
"Probe.CubemapToOctahedral"};
50 PassSimple sum_sh_ps_ = {
"Probe.SumSphericalHarmonics"};
52 PassSimple sum_sun_ps_ = {
"Probe.SumSunlight"};
58 gpu::Texture *convolve_input_ =
nullptr;
60 gpu::Texture *convolve_output_ =
nullptr;
61 int convolve_lod_ = 0;
63 bool extract_sh_ =
false;
65 bool extract_sun_ =
false;
70 int3 dispatch_probe_convolve_ =
int3(1);
71 int3 dispatch_probe_select_ =
int3(1);
78 Texture cubemap_tx_ = {
"Probe.Cubemap"};
82 SphereProbeUvArea probe_sampling_coord_;
83 SphereProbePixelArea probe_write_coord_;
85 SphereProbePixelArea probe_read_coord_;
87 SphereProbeUvArea world_sampling_coord_;
89 int lightprobe_sphere_count_ = 0;
92 StorageArrayBuffer<SphereProbeHarmonic, SPHERE_PROBE_MAX_HARMONIC, true>
93 tmp_spherical_harmonics_ = {
"tmp_spherical_harmonics_"};
95 StorageBuffer<SphereProbeHarmonic, true> spherical_harmonics_ = {
"spherical_harmonics_"};
98 StorageArrayBuffer<SphereProbeSunLight, SPHERE_PROBE_MAX_HARMONIC, true> tmp_sunlight_ = {
101 int extract_sun_index_ = -1;
110 bool update_probes_next_sample_ =
false;
112 bool update_probes_this_sample_ =
false;
114 bool do_world_irradiance_update =
true;
117 bool do_display_draw_ =
false;
119 PassSimple viewport_display_ps_ = {
"ProbeSphereModule.Viewport Display"};
151 return spherical_harmonics_;
166 return max_ii(SPHERE_PROBE_ATLAS_MAX_SUBDIV -
int(probe_resolution), 0);
178 void ensure_cubemap_render_target(
int resolution);
182 void release_render_target();
187 int cube_target_extent;
189 float2 clipping_distances;
196 UpdateInfo update_info_from_probe(SphereProbe &probe);
201 std::optional<UpdateInfo> world_update_info_pop();
202 std::optional<UpdateInfo> probe_update_info_pop();
218 void remap_to_octahedral_projection(
const SphereProbeAtlasCoord &atlas_coord,
219 bool convolve_octahedral,
220 bool extract_spherical_harmonics,
221 int extract_sun = -1);
223 void sync_display(Vector<SphereProbe *> &probe_active);