From f4828a906354e2037438ce4f9976ff7c4191f666 Mon Sep 17 00:00:00 2001 From: "Herholz, Sebastian" Date: Thu, 26 Sep 2024 23:49:11 +0200 Subject: [PATCH] [cleanup] Final fixes for the release --- CHANGELOG.md | 4 ++-- README.md | 4 ++-- doc/changelog_latest.md | 2 +- openpgl/data/PathSegmentDataStorage.h | 4 ++++ openpgl/include/openpgl/common.h | 5 +++-- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index abbc2df..7b4d490 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,8 @@ - Radiance Caching (RC): - If RC is enabled, the guiding structure (i.e., `Field`) learns an - approximation of multiple radiance quantities (in linear RGB) - ,such as outgoing and incoming radiance, irradiance, fluence, and + approximation of multiple radiance quantities (in linear RGB), + such as outgoing and incoming radiance, irradiance, fluence, and in-scattered radiance. These quantities can be queried using the `SurfaceSamplingDistribution` and `VolumeSamplingDistribution` classes. RC support can be enabled using the diff --git a/README.md b/README.md index 5cc38ec..f0132cb 100644 --- a/README.md +++ b/README.md @@ -56,8 +56,8 @@ The full version history can be found [here](./CHANGELOG.md) - Radiance Caching (RC): - If RC is enabled, the guiding structure (i.e., `Field`) learns an - approximation of multiple radiance quantities (in linear RGB) - ,such as outgoing and incoming radiance, irradiance, fluence, and + approximation of multiple radiance quantities (in linear RGB), + such as outgoing and incoming radiance, irradiance, fluence, and in-scattered radiance. These quantities can be queried using the `SurfaceSamplingDistribution` and `VolumeSamplingDistribution` classes. RC support can be enabled using the diff --git a/doc/changelog_latest.md b/doc/changelog_latest.md index 6a7ee69..fb393f0 100644 --- a/doc/changelog_latest.md +++ b/doc/changelog_latest.md @@ -2,7 +2,7 @@ - New (**Experimental**) Features: - Radiance Caching (RC): - - If RC is enabled, the guiding structure (i.e., `Field`) learns an approximation of multiple radiance quantities (in linear RGB) ,such as outgoing and incoming radiance, irradiance, fluence, and in-scattered radiance. These quantities can be queried using the `SurfaceSamplingDistribution` and `VolumeSamplingDistribution` classes. + - If RC is enabled, the guiding structure (i.e., `Field`) learns an approximation of multiple radiance quantities (in linear RGB), such as outgoing and incoming radiance, irradiance, fluence, and in-scattered radiance. These quantities can be queried using the `SurfaceSamplingDistribution` and `VolumeSamplingDistribution` classes. RC support can be enabled using the `OPENPGL_EF_RADIANCE_CACHES` CMake option. **Note:** Since the RC quantities are Monte-Carlo estimates, zero-value samples (`ZeroValueSampleData`) that are generated during rendering/training have to be passed/stored in the `SampleStorage` as well. - Guided/Adjoint-driven Russian Roulette (GRR): - The information stored in radiance caches can be used to optimize stochastic path termination decisions (a.k.a. Russian roulette) to avoid a significant increase in variance (i.e., noise) caused by early terminations, which can occur when using standard throughput-based RR strategies. diff --git a/openpgl/data/PathSegmentDataStorage.h b/openpgl/data/PathSegmentDataStorage.h index ea721fa..8626304 100644 --- a/openpgl/data/PathSegmentDataStorage.h +++ b/openpgl/data/PathSegmentDataStorage.h @@ -261,7 +261,9 @@ struct PathSegmentDataStorage } bool directLightSample = false; +#ifdef OPENPGL_RADIANCE_CACHES float misWeight = 1.f; +#endif // evalaute the incident radiance the incident openpgl::Vector3 throughput{1.0f}; openpgl::Vector3 contribution{0.0f}; @@ -310,7 +312,9 @@ struct PathSegmentDataStorage else { contribution += clampedThroughput * nextPathSegment.miWeight * directContribution; +#ifdef OPENPGL_RADIANCE_CACHES misWeight = nextPathSegment.miWeight; +#endif OPENPGL_ASSERT(embree::isvalid(contribution)); OPENPGL_ASSERT(contribution[0] >= 0.f && contribution[1] >= 0.f && contribution[2] >= 0.f); } diff --git a/openpgl/include/openpgl/common.h b/openpgl/include/openpgl/common.h index 837068b..264f3a1 100644 --- a/openpgl/include/openpgl/common.h +++ b/openpgl/include/openpgl/common.h @@ -267,8 +267,9 @@ struct pgl_spectrum uint32_t spectrum; #ifdef __cplusplus pgl_spectrum() {} - pgl_spectrum(const float r, const float g, const float b) { - spectrum = vec3f2rgbe({r,g,b}); + pgl_spectrum(const float r, const float g, const float b) + { + spectrum = vec3f2rgbe({r, g, b}); } pgl_spectrum(const pgl_vec3f rgb) {