33 friend LightProbeModule;
44 Texture probes_tx_ = {
"Probes"};
47 PassSimple remap_ps_ = {
"Probe.CubemapToOctahedral"};
49 PassSimple sum_sh_ps_ = {
"Probe.SumSphericalHarmonics"};
51 PassSimple sum_sun_ps_ = {
"Probe.SumSunlight"};
57 gpu::Texture *convolve_input_ =
nullptr;
59 gpu::Texture *convolve_output_ =
nullptr;
60 int convolve_lod_ = 0;
62 bool extract_sh_ =
false;
65 int3 dispatch_probe_convolve_ =
int3(1);
66 int3 dispatch_probe_select_ =
int3(1);
73 Texture cubemap_tx_ = {
"Probe.Cubemap"};
77 SphereProbeUvArea probe_sampling_coord_;
78 SphereProbePixelArea probe_write_coord_;
80 SphereProbePixelArea probe_read_coord_;
82 SphereProbeUvArea world_sampling_coord_;
84 int lightprobe_sphere_count_ = 0;
87 StorageArrayBuffer<SphereProbeHarmonic, SPHERE_PROBE_MAX_HARMONIC, true>
88 tmp_spherical_harmonics_ = {
"tmp_spherical_harmonics_"};
90 StorageBuffer<SphereProbeHarmonic, true> spherical_harmonics_ = {
"spherical_harmonics_"};
93 StorageArrayBuffer<SphereProbeSunLight, SPHERE_PROBE_MAX_HARMONIC, true> tmp_sunlight_ = {
103 bool update_probes_next_sample_ =
false;
105 bool update_probes_this_sample_ =
false;
107 bool do_world_irradiance_update =
true;
110 bool do_display_draw_ =
false;
112 PassSimple viewport_display_ps_ = {
"ProbeSphereModule.Viewport Display"};
144 return spherical_harmonics_;
164 void ensure_cubemap_render_target(
int resolution);
169 int cube_target_extent;
171 float2 clipping_distances;
173 SphereProbeAtlasCoord atlas_coord;
178 UpdateInfo update_info_from_probe(SphereProbe &probe);
183 std::optional<UpdateInfo> world_update_info_pop();
184 std::optional<UpdateInfo> probe_update_info_pop();
192 void remap_to_octahedral_projection(
const SphereProbeAtlasCoord &atlas_coord,
193 bool extract_spherical_harmonics);