Showing the changes to libraries/render-utils/src/RenderDeferredTask.cpp (1 of 18 files). Show all
Unified · Split
| @@ -104,6 +104,7 @@ RenderDeferredTask::RenderDeferredTask() : Task() { · 103 unmodified lines | ||
| 104 | 104 | |
| 105 | 105 | // Lighting Buffer ready for tone mapping |
| 106 | 106 | _jobs.push_back(Job(new ToneMappingDeferred::JobModel("ToneMapping"))); |
| 107 | + _toneMappingJobIndex = _jobs.size() - 1; | |
| 107 | 108 | |
| 108 | 109 | // Debugging Deferred buffer job |
| 109 | 110 | _jobs.push_back(Job(new DebugDeferredBuffer::JobModel("DebugDeferredBuffer"))); |
| @@ -164,6 +165,8 @@ void RenderDeferredTask::run(const SceneContextPointer& sceneContext, const Rend · 54 unmodified lines | ||
| 164 | 165 | |
| 165 | 166 | setAntialiasingStatus(renderContext->_fxaaStatus); |
| 166 | 167 | |
| 168 | + setToneMappingExposure(renderContext->_toneMappingExposure); | |
| 169 | + | |
| 167 | 170 | renderContext->args->_context->syncCache(); |
| 168 | 171 | |
| 169 | 172 | for (auto job : _jobs) { |
| @@ -390,3 +393,18 @@ void DrawBackgroundDeferred::run(const SceneContextPointer& sceneContext, const · 220 unmodified lines | ||
| 390 | 393 | }); |
| 391 | 394 | args->_batch = nullptr; |
| 392 | 395 | } |
| 396 | + | |
| 397 | + | |
| 398 | +void RenderDeferredTask::setToneMappingExposure(float exposure) { | |
| 399 | + if (_toneMappingJobIndex >= 0) { | |
| 400 | + _jobs[_toneMappingJobIndex].edit<ToneMappingDeferred>()._toneMappingEffect.setExposure(exposure); | |
| 401 | + } | |
| 402 | +} | |
| 403 | + | |
| 404 | +float RenderDeferredTask::getToneMappingExposure() const { | |
| 405 | + if (_toneMappingJobIndex >= 0) { | |
| 406 | + _jobs[_toneMappingJobIndex].get<ToneMappingDeferred>()._toneMappingEffect.getExposure(); | |
| 407 | + } else { | |
| 408 | + return 0.0f; | |
| 409 | + } | |
| 410 | +} | |