Comments (3)
Good eye--you are correct about all of that. That is actually intended, though a little ugly / unsatisfying. Here's the story...
Samplers must provide a StartPixelSample()
method, which takes a pixel, a sample index, and the dimension of the sample vector to start at. Further, they're supposed to be deterministic about the samples that they generate (new in pbrt-v4, but a real help for debugging, since you can re-render a single pixel and know the same computations will happen for it as for the entire image.)
Now, in the GPU path, Samplers aren't persistent, like they are in the CPU renderer. Rather, Samplers are allocated on the stack in kernels that need them, which is currently a) the camera ray generation kernel, and b) the kernel that generates the samples that will be needed for the next path vertex. So the camera ray kernel starts at dimension 0 as usual, but then the other kernel has to figure out which dimension to start at for each bounce.
Ok, so on to the pmj sampler. On the CPU, we could maintain a separate index into the pmj tables and only increment it when a 2D sample was taken. On the GPU, we sort of don't know how many PMJ dimensions have been consumed when we start at an arbitrary sample dimension. Hence, the way it's implemented. Although that skips over pmj sample table entries, it is deterministic for a given dimension, and at least it never reuses the same table twice in a row...
(Maybe there is a cleaner solution. That is all admittedly a little hacky, but I don't have a better idea...)
from pbrt-v4.
Oh that's interesting, I hadn't dug into the GPU implementation much beyond your HPG talk and YouTube video. Thank you for the explanation!
I'm probably missing something, but could you change it to pmjInstance = dimension/2, while still incrementing by 2? I think that would be deterministic for a given dimension, and it would skip fewer sample sets, although it would still skip one for every 2 Get1D() calls.
from pbrt-v4.
Yep, you're right--good point. Fixed now--thanks!
from pbrt-v4.
Related Issues (20)
- build pbrt in Windows with CUDA errors HOT 3
- Denoiser not being initialized for OptiX 8.0.0
- GPU compiling error with -DPBRT_FLOAT_AS_DOUBLE HOT 1
- Periodic Radiance Values for Spectral Render
- spectrum.h not defined in the pbrt/base
- gpu runs failing: Invalid PTX input HOT 1
- Build issue vs 2022 cuda 12.5 optix 7.7 win 11 HOT 3
- Final image is black when using GPU HOT 2
- GPU rendering not working with MSCV Version 14.40 and newer HOT 1
- A question about CUDA constant memory initialization. HOT 1
- Trouble replicating Radiance results with diffusive materials HOT 2
- Compiling Error aggregate.cpp with optix7 and NVCC 12.5 and GCC 11.4 in Ubuntu 22.04 HOT 2
- simple scattering scene for simplevolpath HOT 2
- Equivalent of Kt and Kr in dielectric material? HOT 3
- Build errors using Linux (both with gcc 13.2.1 and clang 17.0.6) HOT 2
- Default parameters with sample Crown scene is noisy HOT 1
- `pbrt/gpu` and `pbrt/wavefront` compilation fails HOT 1
- Docker file in Ubuntu
- pbrt_exe (Release) crashing HOT 12
- Incorrect Motion Blur with SPPM HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pbrt-v4.