Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path guiding (Google Summer of Code Project) #2656

Open
wants to merge 59 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
c04f34a
Commit initial path guiding sources
BashPrince Jun 12, 2019
ad4fd68
Add PathGuidedSampler for SD-Tree sampling
BashPrince Jun 14, 2019
748eee8
Add path guiding UI settings
BashPrince Jun 14, 2019
e2c828b
Add radiance recording infrastructure
BashPrince Jun 16, 2019
8063616
Merge branch 'master' into path_guiding
BashPrince Jun 16, 2019
eb3046b
Adapt path guiding scattering mode
BashPrince Jun 20, 2019
d57875f
Add pass callback logic
BashPrince Jun 28, 2019
02f7111
Remove TerminatableRendererController
BashPrince Jun 30, 2019
565b360
Cosmetic cleanup
BashPrince Jul 1, 2019
2416d26
Merge branch 'master' into path_guiding
BashPrince Jul 1, 2019
722046f
Small changes in PathGuidedSampler
BashPrince Jul 11, 2019
1dec8ec
Fix CI build errors
BashPrince Jul 11, 2019
db55f23
Merge branch 'master' into path_guiding
BashPrince Jul 11, 2019
c0180ce
Fix variance estimation
BashPrince Jul 14, 2019
e95c61d
Port Mitsuba implementation of SD-tree
BashPrince Jul 21, 2019
da67353
Merge branch 'master' into path_guiding_tree
BashPrince Jul 21, 2019
b1acd42
Implement MySTreeNode
BashPrince Jul 22, 2019
5dc0414
Make choose_node method private
BashPrince Jul 22, 2019
6fd1b87
Further modifications to MySTreeNode
BashPrince Jul 22, 2019
91d130f
Add spatial box filter
BashPrince Jul 23, 2019
bfaa8e8
SD tree implementation WIP
BashPrince Aug 2, 2019
ae5dd51
Backup WIP
BashPrince Aug 4, 2019
70772c1
Ported mitsuba learned bsdf sampling fraction
BashPrince Aug 4, 2019
327c8b5
fraction learning WIP
BashPrince Aug 6, 2019
4be593b
Small changes
BashPrince Aug 7, 2019
98912ab
Add GUI settings and sample combination
BashPrince Aug 12, 2019
eec3e7d
Fix BSDF sampling fraction learning
BashPrince Aug 14, 2019
cc37be3
Conform to styleguide
BashPrince Aug 14, 2019
71a36a3
Changes in PathGuidedSampler
BashPrince Aug 15, 2019
a61d06c
Further changes to PathguidedSampler
BashPrince Aug 16, 2019
b462be0
Several path guiding changes
BashPrince Aug 16, 2019
b8bd774
Various path guiding changes
BashPrince Aug 19, 2019
f7abdc5
Fix bounce parameter GUI bug
BashPrince Aug 20, 2019
577315a
D-Tree samples return ScatteringMode
BashPrince Aug 21, 2019
bd724d5
Working version
BashPrince Aug 21, 2019
03e2655
Improve handling of guided bounce ScatteringMode
BashPrince Aug 21, 2019
64526c2
Fix path guiding ScatteringMode bugs
BashPrince Aug 22, 2019
65e26a0
Merge branch 'master' into path_guiding
BashPrince Aug 22, 2019
b0b128d
Minor changes in STree class
BashPrince Aug 22, 2019
b11cf8e
Fix BSDF sampling fraction bug
BashPrince Aug 22, 2019
be9672e
Combine all channels in inverse variance mixing
BashPrince Aug 22, 2019
bca5a9c
Improve D-Tree ScatteringMode assignment
BashPrince Aug 23, 2019
da1b77e
Cosmetic code changes
BashPrince Aug 23, 2019
d01bad3
Fixes to pass CI
BashPrince Aug 23, 2019
5b46598
More fixes to pass CI
BashPrince Aug 23, 2019
32641d6
Add indirect radiance only when NEE is enabled
BashPrince Aug 25, 2019
20f1cff
Change S-Tree subdivision criterion
BashPrince Aug 25, 2019
4d9b480
Add more SD-Tree statistics
BashPrince Aug 25, 2019
615478e
Final commit for GSoC 2019
BashPrince Aug 25, 2019
16a7428
add breaks
BashPrince Aug 25, 2019
90ddf4b
Add SD-tree disk writing
BashPrince Sep 28, 2019
e3fa458
Merge branch 'master' into path_guiding
BashPrince Oct 3, 2019
569046b
Fix previous error in ProgressTileCallback
BashPrince Oct 3, 2019
3513e47
Correct save iterations mode on UI setup
BashPrince Oct 3, 2019
26bd8c7
Cleanup GPTVertex::record_to_tree
BashPrince Oct 3, 2019
18a42de
Print inverse variance sample combination weights
BashPrince Oct 4, 2019
5487e2b
Reformat statistics printing
BashPrince Oct 4, 2019
bac706e
Merge remote-tracking branch 'upstream/master' into path_guiding
BashPrince Apr 2, 2020
d1cbd9e
Build and bug fixes after merging master
BashPrince Apr 2, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Cleanup GPTVertex::record_to_tree
Handle Spectrum validity checks and multiplications in single loop.
  • Loading branch information
BashPrince committed Oct 3, 2019
commit 26bd8c7ec6ca97cd0b8877893ba78e818ab983ef
28 changes: 12 additions & 16 deletions src/appleseed/renderer/kernel/lighting/sdtree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,6 @@ Vector3f cylindrical_to_cartesian(
cos_theta);
}

bool is_valid_spectrum(
const Spectrum& s)
{
for (int i = 0; i < s.size(); i++)
if (!std::isfinite(s[i]) || s[i] < 0.0f)
return false;
return true;
}

template<typename T>
void write(
std::ofstream& outstream,
Expand Down Expand Up @@ -1359,19 +1350,24 @@ void GPTVertex::record_to_tree(
STree& sd_tree,
SamplingContext& sampling_context)
{
if (!is_valid_spectrum(m_radiance) || !is_valid_spectrum(m_bsdf_value))
return;

Spectrum incoming_radiance(0.0f);
Spectrum incoming_radiance;
Spectrum product;

for(size_t i = 0; i < incoming_radiance.size(); ++i)
for(size_t i = 0; i < Spectrum::size(); ++i)
{
// Check if components are valid.
if (!std::isfinite(m_radiance[i]) || m_radiance[i] < 0.0f ||
!std::isfinite(m_bsdf_value[i]) || m_bsdf_value[i] < 0.0f)
{
return;
}

const float rcp_factor = m_throughput[i] == 0.0f ? 0.0f : 1.0f / m_throughput[i];

incoming_radiance[i] = m_radiance[i] * rcp_factor;
product[i] = incoming_radiance[i] * m_bsdf_value[i];
}

Spectrum product = incoming_radiance * m_bsdf_value;

DTreeRecord d_tree_record{
m_direction,
average_value(incoming_radiance),
Expand Down