Quasirandom sampler
- alpistinho
- Developer
- Posts: 198
- Joined: Thu Jul 05, 2018 11:38 pm
- Location: Rio de Janeiro
Re: Quasirandom sampler
How do I edit the OpenCL code? I see that there are some .cl files, but not for all the things that exist in the C++ code
- alpistinho
- Developer
- Posts: 198
- Joined: Thu Jul 05, 2018 11:38 pm
- Location: Rio de Janeiro
Re: Quasirandom sampler
I've been thinking and I guess it is because each pixel should be sampled according to a separate Sobol sequence. When the pass is increased globally and some pixels were skipped, the distribution for those becomes compromised and worsens the sampling quality.alpistinho wrote: ↑Sun Mar 10, 2019 10:37 pm Why is it bad for sampling that some pixels are skipped?
I will implement the pass variable for each pixel, possible using the Film class. Unfortunately I am in a hurry this week and don't expect to have much time until the next.
Re: Quasirandom sampler
Yes, that it is what I was trying to say in my previous post.alpistinho wrote: ↑Mon Mar 11, 2019 9:48 pmI've been thinking and I guess it is because each pixel should be sampled according to a separate Sobol sequence. When the pass is increased globally and some pixels were skipped, the distribution for those becomes compromised and worsens the sampling quality.alpistinho wrote: ↑Sun Mar 10, 2019 10:37 pm Why is it bad for sampling that some pixels are skipped?
- alpistinho
- Developer
- Posts: 198
- Joined: Thu Jul 05, 2018 11:38 pm
- Location: Rio de Janeiro
Re: Quasirandom sampler
Can't I use the SAMPLECOUNT channel for that? It is stored anyways and counts how many passes each pixel received, no?
I guess I have done something stupid or are not understanding something, since the result does seem to converge but it is funny looking during the rendering.
This is the only code change on SobolSampler::InitNewSample:
Code: Select all
if (rndGen->floatValue() < adaptiveStrength) {
// Skip this pixel and try the next one
continue;
} else {
pixelPass = *(film->channel_SAMPLECOUNT->GetPixel(pixelX, pixelY));
}
...
sample0 = pixelX + sobolSequence.GetSample(pixelPass, 0);
sample1 = pixelY + sobolSequence.GetSample(pixelPass, 1);
Using SAMPLECOUNT as pass Global pass
Re: Quasirandom sampler
There would be a problem with SAMPLECOUNT and hybrid rendering: it is the sum of CPU and GPU work while CPU and GPU threads uses 2 different samplers. The pass count buffer must be part of the SobolSharedData object and updated atomically (i.e. in a thread safe way). Something you can not do across both CPU and GPU.alpistinho wrote: ↑Thu Mar 14, 2019 12:45 am Can't I use the SAMPLECOUNT channel for that? It is stored anyways and counts how many passes each pixel received, no?