提交 208a5fd0 编写于 作者: M Matt Pharr

GPU/wavefront: compute dpdx/dpdy for VisibleSurface at first hit

In turn, this gives us valid dzdx and dzdy values with GBuffer film.
上级 452bb7cc
......@@ -83,6 +83,7 @@ WavefrontPathIntegrator::WavefrontPathIntegrator(Allocator alloc, ParsedScene &s
sampler = Sampler::Create(scene.sampler.name, scene.sampler.parameters,
film.FullResolution(), &scene.sampler.loc, alloc);
samplesPerPixel = sampler.SamplesPerPixel();
Medium cameraMedium = findMedium(scene.camera.medium, &scene.camera.loc);
camera = Camera::Create(scene.camera.name, scene.camera.parameters, cameraMedium,
......@@ -347,7 +348,6 @@ Float WavefrontPathIntegrator::Render() {
Timer timer;
Vector2i resolution = film.PixelBounds().Diagonal();
Bounds2i pixelBounds = film.PixelBounds();
int spp = sampler.SamplesPerPixel();
// Launch thread to copy image for display server, if enabled
RGB *displayRGB = nullptr, *displayRGBHost = nullptr;
std::atomic<bool> exitCopyThread{false};
......@@ -429,7 +429,7 @@ Float WavefrontPathIntegrator::Render() {
});
}
int firstSampleIndex = 0, lastSampleIndex = spp;
int firstSampleIndex = 0, lastSampleIndex = samplesPerPixel;
// Update sample index range based on debug start, if provided
if (!Options->debugStart.empty()) {
std::vector<int> values = SplitStringToInts(Options->debugStart, ',');
......
......@@ -148,7 +148,7 @@ class WavefrontPathIntegrator {
pstd::vector<Light> *envLights;
LightSampler lightSampler;
int maxDepth;
int maxDepth, samplesPerPixel;
bool regularize;
int scanlinesPerPass, maxQueueSize;
......
......@@ -117,6 +117,8 @@ void WavefrontPathIntegrator::EvaluateMaterialAndBSDF(TextureEvaluator texEval,
intr.wo = w.wo;
intr.time = w.time;
camera.ApproximatedPdxy(intr, samplesPerPixel);
// Estimate BSDF's albedo
constexpr int nRhoSamples = 16;
SampledSpectrum rho(0.f);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册