Showing the changes to libraries/render-utils/src/ToneMapAndResampleTask.cpp (1 of 4 files). Show all
Unified · Split
| @@ -29,7 +29,7 @@ ToneMapAndResample::ToneMapAndResample() { · 28 unmodified lines | ||
| 29 | 29 | Parameters parameters; |
| 30 | 30 | _parametersBuffer = gpu::BufferView(std::make_shared<gpu::Buffer>(sizeof(Parameters), (const gpu::Byte*) ¶meters)); |
| 31 | 31 | } |
| 32 | −/* | |
| 32 | + | |
| 33 | 33 | void ToneMapAndResample::init() { |
| 34 | 34 | // shared_ptr to gpu::State |
| 35 | 35 | gpu::StatePointer blitState = gpu::StatePointer(new gpu::State()); |
| @@ -40,7 +40,6 @@ void ToneMapAndResample::init() { · 4 unmodified lines | ||
| 40 | 40 | _pipeline = gpu::PipelinePointer(gpu::Pipeline::create(gpu::Shader::createProgram(toneMapping), blitState)); |
| 41 | 41 | _mirrorPipeline = gpu::PipelinePointer(gpu::Pipeline::create(gpu::Shader::createProgram(toneMapping_mirrored), blitState)); |
| 42 | 42 | } |
| 43 | − */ | |
| 44 | 43 | |
| 45 | 44 | void ToneMapAndResample::setExposure(float exposure) { |
| 46 | 45 | auto& params = _parametersBuffer.get<Parameters>(); |
| @@ -72,21 +71,15 @@ void ToneMapAndResample::run(const RenderContextPointer& renderContext, const In · 25 unmodified lines | ||
| 72 | 71 | auto lightingBuffer = input->getRenderBuffer(0); |
| 73 | 72 | |
| 74 | 73 | resampledFrameBuffer = args->_blitFramebuffer; |
| 75 | −/* | |
| 74 | + | |
| 76 | 75 | if (!lightingBuffer || !resampledFrameBuffer) { |
| 77 | 76 | return; |
| 78 | − }*/ | |
| 77 | + } | |
| 79 | 78 | |
| 80 | 79 | if (resampledFrameBuffer != sourceFramebuffer) { |
| 81 | 80 | |
| 82 | 81 | if (!_pipeline) { |
| 83 | − gpu::StatePointer blitState = gpu::StatePointer(new gpu::State()); | |
| 84 | − | |
| 85 | − blitState->setDepthTest(gpu::State::DepthTest(false, false)); | |
| 86 | − blitState->setColorWriteMask(true, true, true, true); | |
| 87 | − | |
| 88 | − _pipeline = gpu::PipelinePointer(gpu::Pipeline::create(gpu::Shader::createProgram(toneMapping), blitState)); | |
| 89 | − _mirrorPipeline = gpu::PipelinePointer(gpu::Pipeline::create(gpu::Shader::createProgram(toneMapping_mirrored), blitState)); | |
| 82 | + init(); | |
| 90 | 83 | } |
| 91 | 84 | |
| 92 | 85 | const auto bufferSize = resampledFrameBuffer->getSize(); |