Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upStochastic Progressive Photon Mapping (SPPM) #86
Comments
wahn
added
the
enhancement
label
Jan 18, 2019
wahn
self-assigned this
Jan 18, 2019
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
added a commit
that referenced
this issue
Jan 28, 2019
This comment has been minimized.
This comment has been minimized.
|
There are two options (after commit 5f108ce):
Some arguments for option 2: The C++ (release) version takes about 11 seconds to render (multi-threaded): > time ~/builds/pbrt/release/pbrt f16-9a.pbrt
pbrt version 3 (built Dec 4 2018 at 10:10:06) [Detected 8 cores]
...
73.535u 2.423s 0:10.54 720.5% 0+0k 13536+5816io 36pf+0wThe single-threaded (release) version still needs only about 1m5s to render: > time ~/builds/pbrt/release/pbrt --nthreads 1 f16-9a.pbrt
pbrt version 3 (built Dec 4 2018 at 10:10:06) [Detected 8 cores]
...
63.870u 0.716s 1:04.95 99.4% 0+0k 0+5824io 0pf+0wI added some progress bars to the current (single-threaded) Rust executable because the current code runs far too long: > ~/git/github/rs_pbrt/target/release/examples/rs_pbrt -i f16-9a.pbrt
pbrt version 0.5.0 [Detected 8 cores]
...
Generate SPPM visible points ...
9 / 63 [=========================>------------------------------------------------------------------------------------------------------------------------------------------------------------] 14.29 % 0.04/s 22m
...That's the estimate after running the program for about 4 minutes. I did previous runs where it finished that phase but it took over 15 minutes and those stages are repeated many times. So, yes, maybe it's time to investigate via the perf profiler. Here a link from a previous discussion about Profilers and how to interprete results on recursive functions ... |
This comment has been minimized.
This comment has been minimized.
|
After about 15 minutes:
|
This comment has been minimized.
This comment has been minimized.
|
I'm using perf on another machine (where it is installed already). Tell cargo that we’re going to need debugging symbols: $ pwd
/home/jan/git/self_hosted/Rust/pbrt
$ export RUSTFLAGS='-g'
$ make clobber
$ makeWe need to change something (as root) before we can run perf as user: $ pwd
/home/jan/Graphics/Rendering/PBRT/pbrt-v3-scenes/caustic-glass
$ perf record --call-graph=lbr ~/git/self_hosted/Rust/pbrt/target/release/examples/rs_pbrt -i f16-9a.pbrt
perf_event_open(..., PERF_FLAG_FD_CLOEXEC) failed with unexpected error 13 (Permission denied)
perf_event_open(..., 0) failed unexpectedly with error 13 (Permission denied)
Error:
You may not have permission to collect stats.
Consider tweaking /proc/sys/kernel/perf_event_paranoid,
which controls use of the performance events system by
unprivileged users (without CAP_SYS_ADMIN).
The current value is 3:
-1: Allow use of (almost) all events by all users
Ignore mlock limit after perf_event_mlock_kb without CAP_IPC_LOCK
>= 0: Disallow ftrace function tracepoint by users without CAP_SYS_ADMIN
Disallow raw tracepoint access by users without CAP_SYS_ADMIN
>= 1: Disallow CPU event access by users without CAP_SYS_ADMIN
>= 2: Disallow kernel profiling by users without CAP_SYS_ADMIN
To make this setting permanent, edit /etc/sysctl.conf too, e.g.:
kernel.perf_event_paranoid = -1As root: # cat /proc/sys/kernel/perf_event_paranoid
3
# echo "-1" > /proc/sys/kernel/perf_event_paranoid
# cat /proc/sys/kernel/perf_event_paranoid
-1 |
This comment has been minimized.
This comment has been minimized.
|
After approx. one minute: $ perf record --call-graph=lbr ~/git/self_hosted/Rust/pbrt/target/release/examples/rs_pbrt -i f16-9a.pbrt
$ perf report
+ 99.31% 0.00% rs_pbrt rs_pbrt [.] pbrt::core::api::pbrt_cleanup ◆
+ 99.18% 0.11% rs_pbrt rs_pbrt [.] pbrt::integrators::sppm::render_sppm ▒
+ 97.84% 0.03% rs_pbrt rs_pbrt [.] <pbrt::samplers::halton::HaltonSampler as core::clone::Clone>::clone ▒
- 97.71% 97.42% rs_pbrt rs_pbrt [.] <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter ▒
97.41% pbrt::core::api::pbrt_cleanup ▒
- pbrt::integrators::sppm::render_sppm ▒
- 97.41% <pbrt::samplers::halton::HaltonSampler as core::clone::Clone>::clone ▒
<alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter |
This comment has been minimized.
This comment has been minimized.
|
Let's see what happens if we implement the impl GlobalSampler for HaltonSampler {
fn set_sample_number(&mut self, sample_num: i64) -> bool {
// TODO
false
}
} |



wahn commentedJan 18, 2019
Look at chapter 16.2 of the Physically Based Rendering book for the theoretical background on this topic and a simple test scene for caustics. Let's use that scene to see caustic from light passing through the glass becoming increasingly sharper.