History

Gathering the diffusion passes in the SUrfaceGEometryPAss job

samcake committed 10 years ago

Commit ff132fa1 parent 3638a3b7 files · +145 −65Browse files

Unified · Split

7 files
  1. interface/src/Application.cpp +2 −0
  2. libraries/render-utils/src/SurfaceGeometryPass.cpp +110 −33
  3. libraries/render-utils/src/SurfaceGeometryPass.h +21 −3
  4. libraries/render/src/render/BlurTask.cpp +5 −6
  5. libraries/render/src/render/BlurTask.h +3 −3
  6. scripts/developer/utilities/render/statsGPU.qml +0 −5
  7. scripts/developer/utilities/render/surfaceGeometryPass.qml +4 −15
interface/src/Application.cpp+2−0
@@ -305,6 +305,8 @@ public: · 304 unmodified lines
305 // Don't actually crash in debug builds, in case this apparent deadlock is simply from305 // Don't actually crash in debug builds, in case this apparent deadlock is simply from
306 // the developer actively debugging code306 // the developer actively debugging code
307 #ifdef NDEBUG307 #ifdef NDEBUG
308
309
308 deadlockDetectionCrash();310 deadlockDetectionCrash();
309 #endif311 #endif
310 }312 }
libraries/render-utils/src/SurfaceGeometryPass.cpp+110−33
@@ -282,6 +282,10 @@ void SurfaceGeometryFramebuffer::updateLinearDepth(const gpu::TexturePointer& li · 281 unmodified lines
282void SurfaceGeometryFramebuffer::clear() {282void SurfaceGeometryFramebuffer::clear() {
283 _curvatureFramebuffer.reset();283 _curvatureFramebuffer.reset();
284 _curvatureTexture.reset();284 _curvatureTexture.reset();
285 _lowCurvatureFramebuffer.reset();
286 _lowCurvatureTexture.reset();
287 _blurringFramebuffer.reset();
288 _blurringTexture.reset();
285}289}
286 290
287gpu::TexturePointer SurfaceGeometryFramebuffer::getLinearDepthTexture() {291gpu::TexturePointer SurfaceGeometryFramebuffer::getLinearDepthTexture() {
@@ -293,9 +297,17 @@ void SurfaceGeometryFramebuffer::allocate() { · 5 unmodified lines
293 auto width = _frameSize.x;297 auto width = _frameSize.x;
294 auto height = _frameSize.y;298 auto height = _frameSize.y;
295 299
296 _curvatureTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element::COLOR_RGBA_32, width >> getResolutionLevel(), height >> getResolutionLevel(), gpu::Sampler(gpu::Sampler::FILTER_MIN_MAG_LINEAR_MIP_POINT)));300 _curvatureTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element::COLOR_RGBA_32, width, height, gpu::Sampler(gpu::Sampler::FILTER_MIN_MAG_LINEAR_MIP_POINT)));
297 _curvatureFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create());301 _curvatureFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create());
298 _curvatureFramebuffer->setRenderBuffer(0, _curvatureTexture);302 _curvatureFramebuffer->setRenderBuffer(0, _curvatureTexture);
303
304 _lowCurvatureTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element::COLOR_RGBA_32, width, height, gpu::Sampler(gpu::Sampler::FILTER_MIN_MAG_LINEAR_MIP_POINT)));
305 _lowCurvatureFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create());
306 _lowCurvatureFramebuffer->setRenderBuffer(0, _lowCurvatureTexture);
307
308 _blurringTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element::COLOR_RGBA_32, width, height, gpu::Sampler(gpu::Sampler::FILTER_MIN_MAG_LINEAR_MIP_POINT)));
309 _blurringFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create());
310 _blurringFramebuffer->setRenderBuffer(0, _blurringTexture);
299}311}
300 312
301gpu::FramebufferPointer SurfaceGeometryFramebuffer::getCurvatureFramebuffer() {313gpu::FramebufferPointer SurfaceGeometryFramebuffer::getCurvatureFramebuffer() {
@@ -312,6 +324,34 @@ gpu::TexturePointer SurfaceGeometryFramebuffer::getCurvatureTexture() { · 10 unmodified lines
312 return _curvatureTexture;324 return _curvatureTexture;
313}325}
314 326
327gpu::FramebufferPointer SurfaceGeometryFramebuffer::getLowCurvatureFramebuffer() {
328 if (!_lowCurvatureFramebuffer) {
329 allocate();
330 }
331 return _lowCurvatureFramebuffer;
332}
333
334gpu::TexturePointer SurfaceGeometryFramebuffer::getLowCurvatureTexture() {
335 if (!_lowCurvatureTexture) {
336 allocate();
337 }
338 return _lowCurvatureTexture;
339}
340
341gpu::FramebufferPointer SurfaceGeometryFramebuffer::getBlurringFramebuffer() {
342 if (!_blurringFramebuffer) {
343 allocate();
344 }
345 return _blurringFramebuffer;
346}
347
348gpu::TexturePointer SurfaceGeometryFramebuffer::getBlurringTexture() {
349 if (!_blurringTexture) {
350 allocate();
351 }
352 return _blurringTexture;
353}
354
315void SurfaceGeometryFramebuffer::setResolutionLevel(int resolutionLevel) {355void SurfaceGeometryFramebuffer::setResolutionLevel(int resolutionLevel) {
316 if (resolutionLevel != getResolutionLevel()) {356 if (resolutionLevel != getResolutionLevel()) {
317 clear();357 clear();
@@ -320,8 +360,7 @@ void SurfaceGeometryFramebuffer::setResolutionLevel(int resolutionLevel) { · 2 unmodified lines
320}360}
321 361
322SurfaceGeometryPass::SurfaceGeometryPass() :362SurfaceGeometryPass::SurfaceGeometryPass() :
323 _firstBlurPass(false),363 _diffusePass(false)
324 _secondBlurPass(true, _firstBlurPass.getParameters())
325{364{
326 Parameters parameters;365 Parameters parameters;
327 _parametersBuffer = gpu::BufferView(std::make_shared<gpu::Buffer>(sizeof(Parameters), (const gpu::Byte*) &parameters));366 _parametersBuffer = gpu::BufferView(std::make_shared<gpu::Buffer>(sizeof(Parameters), (const gpu::Byte*) &parameters));
@@ -345,6 +384,10 @@ void SurfaceGeometryPass::configure(const Config& config) { · 17 unmodified lines
345 _surfaceGeometryFramebuffer = std::make_shared<SurfaceGeometryFramebuffer>();384 _surfaceGeometryFramebuffer = std::make_shared<SurfaceGeometryFramebuffer>();
346 }385 }
347 _surfaceGeometryFramebuffer->setResolutionLevel(config.resolutionLevel);386 _surfaceGeometryFramebuffer->setResolutionLevel(config.resolutionLevel);
387
388 _diffusePass.getParameters()->setFilterRadiusScale(config.diffuseFilterScale);
389 _diffusePass.getParameters()->setDepthThreshold(config.diffuseDepthThreshold);
390
348}391}
349 392
350 393
@@ -358,33 +401,52 @@ void SurfaceGeometryPass::run(const render::SceneContextPointer& sceneContext, c · 7 unmodified lines
358 const auto deferredFramebuffer = inputs.get1();401 const auto deferredFramebuffer = inputs.get1();
359 const auto linearDepthFramebuffer = inputs.get2();402 const auto linearDepthFramebuffer = inputs.get2();
360 403
361 auto linearDepthTexture = linearDepthFramebuffer->getHalfLinearDepthTexture();404
405 auto linearDepthTexture = linearDepthFramebuffer->getLinearDepthTexture();
406 auto normalTexture = deferredFramebuffer->getDeferredNormalTexture();
407 auto sourceViewport = args->_viewport;
408 auto curvatureViewport = sourceViewport;
409
410 if (_surfaceGeometryFramebuffer->getResolutionLevel() > 0) {
411 linearDepthTexture = linearDepthFramebuffer->getHalfLinearDepthTexture();
412 normalTexture = linearDepthFramebuffer->getHalfNormalTexture();
413 curvatureViewport = curvatureViewport >> _surfaceGeometryFramebuffer->getResolutionLevel();
414 }
362 415
363 if (!_surfaceGeometryFramebuffer) {416 if (!_surfaceGeometryFramebuffer) {
364 _surfaceGeometryFramebuffer = std::make_shared<SurfaceGeometryFramebuffer>();417 _surfaceGeometryFramebuffer = std::make_shared<SurfaceGeometryFramebuffer>();
365 }418 }
366 _surfaceGeometryFramebuffer->updateLinearDepth(linearDepthTexture);419 _surfaceGeometryFramebuffer->updateLinearDepth(linearDepthTexture);
367 420
368 // auto normalTexture = deferredFramebuffer->getDeferredNormalTexture();
369 auto normalTexture = linearDepthFramebuffer->getHalfNormalTexture();
370
371 auto curvatureFramebuffer = _surfaceGeometryFramebuffer->getCurvatureFramebuffer();421 auto curvatureFramebuffer = _surfaceGeometryFramebuffer->getCurvatureFramebuffer();
422 auto curvatureTexture = _surfaceGeometryFramebuffer->getCurvatureTexture();
372#ifdef USE_STENCIL_TEST423#ifdef USE_STENCIL_TEST
373 if (curvatureFBO->getDepthStencilBuffer() != deferredFramebuffer->getPrimaryDepthTexture()) {424 if (curvatureFramebuffer->getDepthStencilBuffer() != deferredFramebuffer->getPrimaryDepthTexture()) {
374 curvatureFBO->setDepthStencilBuffer(deferredFramebuffer->getPrimaryDepthTexture(), deferredFramebuffer->getPrimaryDepthTexture()->getTexelFormat());425 curvatureFramebuffer->setDepthStencilBuffer(deferredFramebuffer->getPrimaryDepthTexture(), deferredFramebuffer->getPrimaryDepthTexture()->getTexelFormat());
375 }426 }
376#endif427#endif
377 auto curvatureTexture = _surfaceGeometryFramebuffer->getCurvatureTexture();428
429 auto lowCurvatureFramebuffer = _surfaceGeometryFramebuffer->getLowCurvatureFramebuffer();
430 auto lowCurvatureTexture = _surfaceGeometryFramebuffer->getLowCurvatureTexture();
431
432 auto blurringFramebuffer = _surfaceGeometryFramebuffer->getBlurringFramebuffer();
433 auto blurringTexture = _surfaceGeometryFramebuffer->getBlurringTexture();
378 434
379 outputs.edit0() = _surfaceGeometryFramebuffer;435 outputs.edit0() = _surfaceGeometryFramebuffer;
380 outputs.edit1() = curvatureFramebuffer;436 outputs.edit1() = curvatureFramebuffer;
437 outputs.edit2() = curvatureFramebuffer;
438 outputs.edit3() = lowCurvatureFramebuffer;
381 439
382 auto curvaturePipeline = getCurvaturePipeline();440 auto curvaturePipeline = getCurvaturePipeline();
441 auto diffuseVPipeline = _diffusePass.getBlurVPipeline();
442 auto diffuseHPipeline = _diffusePass.getBlurHPipeline();
383 443
384 auto depthViewport = args->_viewport;444 glm::ivec2 textureSize(curvatureTexture->getDimensions());
385 auto curvatureViewport = depthViewport >> 1;445 _diffusePass.getParameters()->setTexcoordTransform(gpu::Framebuffer::evalSubregionTexcoordTransformCoefficients(textureSize, curvatureViewport));
386 // >> _surfaceGeometryFramebuffer->getResolutionLevel();446 _diffusePass.getParameters()->setDepthPerspective(args->getViewFrustum().getProjection()[1][1]);
447 _diffusePass.getParameters()->setLinearDepthPosFar(args->getViewFrustum().getFarClip());
387 448
449
388 gpu::doInBatch(args->_context, [=](gpu::Batch& batch) {450 gpu::doInBatch(args->_context, [=](gpu::Batch& batch) {
389 _gpuTimer.begin(batch);451 _gpuTimer.begin(batch);
390 batch.enableStereo(false);452 batch.enableStereo(false);
@@ -393,43 +455,58 @@ void SurfaceGeometryPass::run(const render::SceneContextPointer& sceneContext, c · 2 unmodified lines
393 batch.setViewTransform(Transform());455 batch.setViewTransform(Transform());
394 456
395 batch.setViewportTransform(curvatureViewport);457 batch.setViewportTransform(curvatureViewport);
396 batch.setModelTransform(gpu::Framebuffer::evalSubregionTexcoordTransform(_surfaceGeometryFramebuffer->getCurvatureFrameSize(), curvatureViewport));458 batch.setModelTransform(gpu::Framebuffer::evalSubregionTexcoordTransform(_surfaceGeometryFramebuffer->getSourceFrameSize(), curvatureViewport));
397 459
460 // Curvature pass
398 batch.setUniformBuffer(SurfaceGeometryPass_FrameTransformSlot, frameTransform->getFrameTransformBuffer());461 batch.setUniformBuffer(SurfaceGeometryPass_FrameTransformSlot, frameTransform->getFrameTransformBuffer());
399 batch.setUniformBuffer(SurfaceGeometryPass_ParamsSlot, _parametersBuffer);462 batch.setUniformBuffer(SurfaceGeometryPass_ParamsSlot, _parametersBuffer);
400
401 // Curvature pass
402 batch.setFramebuffer(curvatureFramebuffer);463 batch.setFramebuffer(curvatureFramebuffer);
403 464 // We can avoid the clear by drawing the same clear vallue from the makeCurvature shader. same performances or no worse
404 // We can avoid the clear by drawing the same clear vallue from the makeCurvature shader. same performances or no worse
405
406#ifdef USE_STENCIL_TEST465#ifdef USE_STENCIL_TEST
407 // Except if stenciling out466 // Except if stenciling out
408 batch.clearColorFramebuffer(gpu::Framebuffer::BUFFER_COLOR0, glm::vec4(0.0));467 batch.clearColorFramebuffer(gpu::Framebuffer::BUFFER_COLOR0, glm::vec4(0.0));
409#endif468#endif
410
411 batch.setPipeline(curvaturePipeline);469 batch.setPipeline(curvaturePipeline);
412 batch.setResourceTexture(SurfaceGeometryPass_DepthMapSlot, linearDepthTexture);470 batch.setResourceTexture(SurfaceGeometryPass_DepthMapSlot, linearDepthTexture);
413 batch.setResourceTexture(SurfaceGeometryPass_NormalMapSlot, normalTexture);471 batch.setResourceTexture(SurfaceGeometryPass_NormalMapSlot, normalTexture);
414 batch.draw(gpu::TRIANGLE_STRIP, 4);472 batch.draw(gpu::TRIANGLE_STRIP, 4);
415 473
416 batch.setResourceTexture(SurfaceGeometryPass_DepthMapSlot, nullptr);474 // Diffusion pass
417 batch.setResourceTexture(SurfaceGeometryPass_NormalMapSlot, nullptr);475 const int BlurTask_ParamsSlot = 0;
476 const int BlurTask_SourceSlot = 0;
477 const int BlurTask_DepthSlot = 1;
478 batch.setUniformBuffer(BlurTask_ParamsSlot, _diffusePass.getParameters()->_parametersBuffer);
418 479
419 _gpuTimer.end(batch);480 batch.setResourceTexture(BlurTask_DepthSlot, linearDepthTexture);
420 });481
482 batch.setFramebuffer(blurringFramebuffer);
483 batch.setPipeline(diffuseVPipeline);
484 batch.setResourceTexture(BlurTask_SourceSlot, curvatureTexture);
485 batch.draw(gpu::TRIANGLE_STRIP, 4);
421 486
422 const auto diffuseCurvaturePassInputs = render::BlurGaussianDepthAware::Inputs(curvatureFramebuffer, linearDepthTexture);487 batch.setFramebuffer(curvatureFramebuffer);
423 gpu::FramebufferPointer midBlurredFramebuffer;488 batch.setPipeline(diffuseHPipeline);
424 _firstBlurPass.run(sceneContext, renderContext, diffuseCurvaturePassInputs, midBlurredFramebuffer);489 batch.setResourceTexture(BlurTask_SourceSlot, blurringTexture);
490 batch.draw(gpu::TRIANGLE_STRIP, 4);
425 491
426 gpu::FramebufferPointer lowBlurredFramebuffer;492 batch.setFramebuffer(blurringFramebuffer);
427 _secondBlurPass.run(sceneContext, renderContext, diffuseCurvaturePassInputs, lowBlurredFramebuffer);493 batch.setPipeline(diffuseVPipeline);
428 494 batch.setResourceTexture(BlurTask_SourceSlot, curvatureTexture);
429 495 batch.draw(gpu::TRIANGLE_STRIP, 4);
430 outputs.edit2() = midBlurredFramebuffer;
431 outputs.edit3() = lowBlurredFramebuffer;
432 496
497 batch.setFramebuffer(lowCurvatureFramebuffer);
498 batch.setPipeline(diffuseHPipeline);
499 batch.setResourceTexture(BlurTask_SourceSlot, blurringTexture);
500 batch.draw(gpu::TRIANGLE_STRIP, 4);
501
502 batch.setResourceTexture(BlurTask_SourceSlot, nullptr);
503 batch.setResourceTexture(BlurTask_DepthSlot, nullptr);
504 batch.setUniformBuffer(BlurTask_ParamsSlot, nullptr);
505
506 _gpuTimer.end(batch);
507 });
508
509
433 auto config = std::static_pointer_cast<Config>(renderContext->jobConfig);510 auto config = std::static_pointer_cast<Config>(renderContext->jobConfig);
434 config->gpuTime = _gpuTimer.getAverage();511 config->gpuTime = _gpuTimer.getAverage();
435}512}
libraries/render-utils/src/SurfaceGeometryPass.h+21−3
@@ -112,12 +112,17 @@ public: · 111 unmodified lines
112 112
113 gpu::FramebufferPointer getCurvatureFramebuffer();113 gpu::FramebufferPointer getCurvatureFramebuffer();
114 gpu::TexturePointer getCurvatureTexture();114 gpu::TexturePointer getCurvatureTexture();
115
116 gpu::FramebufferPointer getLowCurvatureFramebuffer();
117 gpu::TexturePointer getLowCurvatureTexture();
118
119 gpu::FramebufferPointer getBlurringFramebuffer();
120 gpu::TexturePointer getBlurringTexture();
115 121
116 // Update the source framebuffer size which will drive the allocation of all the other resources.122 // Update the source framebuffer size which will drive the allocation of all the other resources.
117 void updateLinearDepth(const gpu::TexturePointer& linearDepthBuffer);123 void updateLinearDepth(const gpu::TexturePointer& linearDepthBuffer);
118 gpu::TexturePointer getLinearDepthTexture();124 gpu::TexturePointer getLinearDepthTexture();
119 const glm::ivec2& getSourceFrameSize() const { return _frameSize; }125 const glm::ivec2& getSourceFrameSize() const { return _frameSize; }
120 glm::ivec2 getCurvatureFrameSize() const { return _frameSize >> _resolutionLevel; }
121 126
122 void setResolutionLevel(int level);127 void setResolutionLevel(int level);
123 int getResolutionLevel() const { return _resolutionLevel; }128 int getResolutionLevel() const { return _resolutionLevel; }
@@ -131,6 +136,12 @@ protected: · 7 unmodified lines
131 gpu::FramebufferPointer _curvatureFramebuffer;136 gpu::FramebufferPointer _curvatureFramebuffer;
132 gpu::TexturePointer _curvatureTexture;137 gpu::TexturePointer _curvatureTexture;
133 138
139 gpu::FramebufferPointer _blurringFramebuffer;
140 gpu::TexturePointer _blurringTexture;
141
142 gpu::FramebufferPointer _lowCurvatureFramebuffer;
143 gpu::TexturePointer _lowCurvatureTexture;
144
134 glm::ivec2 _frameSize;145 glm::ivec2 _frameSize;
135 int _resolutionLevel{ 0 };146 int _resolutionLevel{ 0 };
136};147};
@@ -143,6 +154,10 @@ class SurfaceGeometryPassConfig : public render::Job::Config { · 6 unmodified lines
143 Q_PROPERTY(float basisScale MEMBER basisScale NOTIFY dirty)154 Q_PROPERTY(float basisScale MEMBER basisScale NOTIFY dirty)
144 Q_PROPERTY(float curvatureScale MEMBER curvatureScale NOTIFY dirty)155 Q_PROPERTY(float curvatureScale MEMBER curvatureScale NOTIFY dirty)
145 Q_PROPERTY(int resolutionLevel MEMBER resolutionLevel NOTIFY dirty)156 Q_PROPERTY(int resolutionLevel MEMBER resolutionLevel NOTIFY dirty)
157
158 Q_PROPERTY(float diffuseFilterScale MEMBER diffuseFilterScale NOTIFY dirty)
159 Q_PROPERTY(float diffuseDepthThreshold MEMBER diffuseDepthThreshold NOTIFY dirty)
160
146 Q_PROPERTY(double gpuTime READ getGpuTime)161 Q_PROPERTY(double gpuTime READ getGpuTime)
147public:162public:
148 SurfaceGeometryPassConfig() : render::Job::Config(true) {}163 SurfaceGeometryPassConfig() : render::Job::Config(true) {}
@@ -151,6 +166,8 @@ public: · 2 unmodified lines
151 float basisScale{ 1.0f };166 float basisScale{ 1.0f };
152 float curvatureScale{ 10.0f };167 float curvatureScale{ 10.0f };
153 int resolutionLevel{ 0 };168 int resolutionLevel{ 0 };
169 float diffuseFilterScale{ 0.2f };
170 float diffuseDepthThreshold{ 1.0f };
154 171
155 double getGpuTime() { return gpuTime; }172 double getGpuTime() { return gpuTime; }
156 173
@@ -191,14 +208,15 @@ private: · 34 unmodified lines
191 };208 };
192 gpu::BufferView _parametersBuffer;209 gpu::BufferView _parametersBuffer;
193 210
211
194 SurfaceGeometryFramebufferPointer _surfaceGeometryFramebuffer;212 SurfaceGeometryFramebufferPointer _surfaceGeometryFramebuffer;
195 213
196 const gpu::PipelinePointer& getCurvaturePipeline();214 const gpu::PipelinePointer& getCurvaturePipeline();
197 215
198 gpu::PipelinePointer _curvaturePipeline;216 gpu::PipelinePointer _curvaturePipeline;
217
218 render::BlurGaussianDepthAware _diffusePass;
199 219
200 render::BlurGaussianDepthAware _firstBlurPass;
201 render::BlurGaussianDepthAware _secondBlurPass;
202 220
203 gpu::RangeTimer _gpuTimer;221 gpu::RangeTimer _gpuTimer;
204};222};
libraries/render/src/render/BlurTask.cpp+5−6
@@ -337,24 +337,23 @@ void BlurGaussianDepthAware::run(const SceneContextPointer& sceneContext, const · 336 unmodified lines
337 auto blurHPipeline = getBlurHPipeline();337 auto blurHPipeline = getBlurHPipeline();
338 338
339 auto sourceViewport = args->_viewport;339 auto sourceViewport = args->_viewport;
340 auto blurViewport = sourceViewport >> 1;
341 340
342 _parameters->setWidthHeight(blurViewport.z, blurViewport.w, args->_context->isStereo());341 _parameters->setWidthHeight(sourceViewport.z, sourceViewport.w, args->_context->isStereo());
343 glm::ivec2 textureSize(blurringResources.sourceTexture->getDimensions());342 glm::ivec2 textureSize(blurringResources.sourceTexture->getDimensions());
344 _parameters->setTexcoordTransform(gpu::Framebuffer::evalSubregionTexcoordTransformCoefficients(textureSize, blurViewport));343 _parameters->setTexcoordTransform(gpu::Framebuffer::evalSubregionTexcoordTransformCoefficients(textureSize, sourceViewport));
345 _parameters->setDepthPerspective(args->getViewFrustum().getProjection()[1][1]);344 _parameters->setDepthPerspective(args->getViewFrustum().getProjection()[1][1]);
346 _parameters->setLinearDepthPosFar(args->getViewFrustum().getFarClip());345 _parameters->setLinearDepthPosFar(args->getViewFrustum().getFarClip());
347 346
348 gpu::doInBatch(args->_context, [=](gpu::Batch& batch) {347 gpu::doInBatch(args->_context, [=](gpu::Batch& batch) {
349 batch.enableStereo(false);348 batch.enableStereo(false);
350 batch.setViewportTransform(blurViewport);349 batch.setViewportTransform(sourceViewport);
351 350
352 batch.setUniformBuffer(BlurTask_ParamsSlot, _parameters->_parametersBuffer);351 batch.setUniformBuffer(BlurTask_ParamsSlot, _parameters->_parametersBuffer);
353 352
354 batch.setResourceTexture(BlurTask_DepthSlot, depthTexture);353 batch.setResourceTexture(BlurTask_DepthSlot, depthTexture);
355 354
356 batch.setFramebuffer(blurringResources.blurringFramebuffer);355 batch.setFramebuffer(blurringResources.blurringFramebuffer);
357 // batch.clearColorFramebuffer(gpu::Framebuffer::BUFFER_COLOR0, glm::vec4(0.0));356 // batch.clearColorFramebuffer(gpu::Framebuffer::BUFFER_COLOR0, glm::vec4(0.0));
358 357
359 batch.setPipeline(blurVPipeline);358 batch.setPipeline(blurVPipeline);
360 batch.setResourceTexture(BlurTask_SourceSlot, blurringResources.sourceTexture);359 batch.setResourceTexture(BlurTask_SourceSlot, blurringResources.sourceTexture);
@@ -362,7 +361,7 @@ void BlurGaussianDepthAware::run(const SceneContextPointer& sceneContext, const · 1 unmodified line
362 361
363 batch.setFramebuffer(blurringResources.finalFramebuffer);362 batch.setFramebuffer(blurringResources.finalFramebuffer);
364 if (_inOutResources._generateOutputFramebuffer) {363 if (_inOutResources._generateOutputFramebuffer) {
365 // batch.clearColorFramebuffer(gpu::Framebuffer::BUFFER_COLOR0, glm::vec4(0.0));364 // batch.clearColorFramebuffer(gpu::Framebuffer::BUFFER_COLOR0, glm::vec4(0.0));
366 }365 }
367 366
368 batch.setPipeline(blurHPipeline);367 batch.setPipeline(blurHPipeline);
libraries/render/src/render/BlurTask.h+3−3
@@ -144,6 +144,9 @@ public: · 143 unmodified lines
144 void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const Inputs& SourceAndDepth, gpu::FramebufferPointer& blurredFramebuffer);144 void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const Inputs& SourceAndDepth, gpu::FramebufferPointer& blurredFramebuffer);
145 145
146 const BlurParamsPointer& getParameters() const { return _parameters; }146 const BlurParamsPointer& getParameters() const { return _parameters; }
147
148 gpu::PipelinePointer getBlurVPipeline();
149 gpu::PipelinePointer getBlurHPipeline();
147 150
148protected:151protected:
149 152
@@ -152,9 +155,6 @@ protected: · 2 unmodified lines
152 gpu::PipelinePointer _blurVPipeline;155 gpu::PipelinePointer _blurVPipeline;
153 gpu::PipelinePointer _blurHPipeline;156 gpu::PipelinePointer _blurHPipeline;
154 157
155 gpu::PipelinePointer getBlurVPipeline();
156 gpu::PipelinePointer getBlurHPipeline();
157
158 BlurInOutResource _inOutResources;158 BlurInOutResource _inOutResources;
159};159};
160 160
scripts/developer/utilities/render/statsGPU.qml+0−5
@@ -53,11 +53,6 @@ Item { · 52 unmodified lines
53 prop: "gpuTime",53 prop: "gpuTime",
54 label: "SurfaceGeometry",54 label: "SurfaceGeometry",
55 color: "#00FFFF"55 color: "#00FFFF"
56 },{
57 object: Render.getConfig("CurvatureRangeTimer"),
58 prop: "gpuTime",
59 label: "Curvature",
60 color: "#00FF00"
61 },56 },
62 {57 {
63 object: Render.getConfig("RenderDeferred"),58 object: Render.getConfig("RenderDeferred"),
scripts/developer/utilities/render/surfaceGeometryPass.qml+4−15
@@ -41,16 +41,11 @@ Column { · 40 unmodified lines
41 min: 0.041 min: 0.0
42 }42 }
43 }43 }
44 }44
45
46 Column{
47 CheckBox {
48 text: "Diffuse Curvature Mid"
49 checked: true
50 onCheckedChanged: { Render.getConfig("DiffuseCurvatureMid").enabled = checked }
51 }
52 Repeater {45 Repeater {
53 model: [ "Blur Scale:DiffuseCurvatureMid:filterScale:2.0", "Blur Depth Threshold:DiffuseCurvatureMid:depthThreshold:1.0", "Blur Scale2:DiffuseCurvatureLow:filterScale:2.0", "Blur Depth Threshold 2:DiffuseCurvatureLow:depthThreshold:1.0"]46 model: [ "Diffusion Scale:SurfaceGeometry:diffuseFilterScale:2.0",
47 "Diffusion Depth Threshold:SurfaceGeometry:diffuseDepthThreshold:1.0"
48 ]
54 ConfigSlider {49 ConfigSlider {
55 label: qsTr(modelData.split(":")[0])50 label: qsTr(modelData.split(":")[0])
56 integral: false51 integral: false
@@ -60,12 +55,6 @@ Column { · 3 unmodified lines
60 min: 0.055 min: 0.0
61 }56 }
62 }57 }
63
64 CheckBox {
65 text: "Diffuse Curvature Low"
66 checked: true
67 onCheckedChanged: { Render.getConfig("DiffuseCurvatureLow").enabled = checked }
68 }
69 }58 }
70 }59 }
71}60}