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)
- The result of pbrt_v4 gpu operation at Pavilon-night is noisy HOT 4
- SubsurfaceMaterial::ToString() is missing the normalMap HOT 1
- Double precision is not working... Optix BVH ? HOT 10
- .obj to pbrt conversion HOT 1
- MIS misbehaves: improvement for direct illumination HOT 2
- pbrt v4 book formula 13.9 maybe error HOT 2
- Material "subsurface" appears to behave strangely.
- imgtool denoise-optix crashing HOT 1
- imgtool: unknown command "denoise-optix". usage: imgtool <command> [options] where <command> is: HOT 8
- -- Unable to find -lprofiler HOT 2
- InlinedVector sometimes behave differently than std::vector HOT 3
- Incorrect SurfaceInteraction for quadric surfaces HOT 1
- GPU Build issue: cuda not found HOT 3
- How to set the CMAKE_CUDA_ARCHITECTURES value? nvcc fatal : Option '--ptx (-ptx)' is not allowed when compiling for multiple GPU architectures HOT 3
- Tests failing on Apple Silicon (Ventura OS) HOT 12
- Warning: image doesn't have Albedo.{R,G,B} channels. Denoising quality may suffer. Warning: output/bistro_vespa.exr: image doesn't have Ns.X, Ns.Y, Ns.Z channels. Denoising quality may suffer. HOT 2
- Double precision is not working... for normals? HOT 1
- Request: Optix SER support (requires Optix 8.0) HOT 1
- Increasing iterations for Hair BSDF
- Normals: Tangent space to world space transforms errors HOT 4
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.