BsPostProcessing.cpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #include "BsPostProcessing.h"
  4. #include "BsRenderTexture.h"
  5. #include "BsGpuResourcePool.h"
  6. #include "BsRendererUtility.h"
  7. #include "BsTextureManager.h"
  8. #include "BsCamera.h"
  9. #include "BsGpuParamsSet.h"
  10. #include "BsRendererCamera.h"
  11. namespace bs { namespace ct
  12. {
  13. DownsampleParamDef gDownsampleParamDef;
  14. DownsampleMat::DownsampleMat()
  15. {
  16. mParamBuffer = gDownsampleParamDef.createBuffer();
  17. mParamsSet->setParamBlockBuffer("Input", mParamBuffer);
  18. mParamsSet->getGpuParams()->getTextureParam(GPT_FRAGMENT_PROGRAM, "gInputTex", mInputTexture);
  19. }
  20. void DownsampleMat::_initDefines(ShaderDefines& defines)
  21. {
  22. // Do nothing
  23. }
  24. void DownsampleMat::execute(const SPtr<Texture>& target, PostProcessInfo& ppInfo)
  25. {
  26. // Set parameters
  27. mInputTexture.set(target);
  28. const TextureProperties& rtProps = target->getProperties();
  29. Vector2 invTextureSize(1.0f / rtProps.getWidth(), 1.0f / rtProps.getHeight());
  30. gDownsampleParamDef.gInvTexSize.set(mParamBuffer, invTextureSize);
  31. // Set output
  32. UINT32 width = std::max(1, Math::ceilToInt(rtProps.getWidth() * 0.5f));
  33. UINT32 height = std::max(1, Math::ceilToInt(rtProps.getHeight() * 0.5f));
  34. mOutputDesc = POOLED_RENDER_TEXTURE_DESC::create2D(rtProps.getFormat(), width, height, TU_RENDERTARGET);
  35. // Render
  36. ppInfo.downsampledSceneTex = GpuResourcePool::instance().get(mOutputDesc);
  37. RenderAPI& rapi = RenderAPI::instance();
  38. rapi.setRenderTarget(ppInfo.downsampledSceneTex->renderTexture, true);
  39. gRendererUtility().setPass(mMaterial);
  40. gRendererUtility().setPassParams(mParamsSet);
  41. gRendererUtility().drawScreenQuad();
  42. rapi.setRenderTarget(nullptr);
  43. mOutput = ppInfo.downsampledSceneTex->renderTexture;
  44. }
  45. void DownsampleMat::release(PostProcessInfo& ppInfo)
  46. {
  47. GpuResourcePool::instance().release(ppInfo.downsampledSceneTex);
  48. mOutput = nullptr;
  49. }
  50. EyeAdaptHistogramParamDef gEyeAdaptHistogramParamDef;
  51. EyeAdaptHistogramMat::EyeAdaptHistogramMat()
  52. {
  53. mParamBuffer = gEyeAdaptHistogramParamDef.createBuffer();
  54. mParamsSet->setParamBlockBuffer("Input", mParamBuffer);
  55. SPtr<GpuParams> params = mParamsSet->getGpuParams();
  56. params->getTextureParam(GPT_COMPUTE_PROGRAM, "gSceneColorTex", mSceneColor);
  57. params->getLoadStoreTextureParam(GPT_COMPUTE_PROGRAM, "gOutputTex", mOutputTex);
  58. }
  59. void EyeAdaptHistogramMat::_initDefines(ShaderDefines& defines)
  60. {
  61. defines.set("THREADGROUP_SIZE_X", THREAD_GROUP_SIZE_X);
  62. defines.set("THREADGROUP_SIZE_Y", THREAD_GROUP_SIZE_Y);
  63. defines.set("LOOP_COUNT_X", LOOP_COUNT_X);
  64. defines.set("LOOP_COUNT_Y", LOOP_COUNT_Y);
  65. }
  66. void EyeAdaptHistogramMat::execute(PostProcessInfo& ppInfo)
  67. {
  68. // Set parameters
  69. SPtr<RenderTexture> target = ppInfo.downsampledSceneTex->renderTexture;
  70. mSceneColor.set(ppInfo.downsampledSceneTex->texture);
  71. const RenderTextureProperties& props = target->getProperties();
  72. int offsetAndSize[4] = { 0, 0, (INT32)props.getWidth(), (INT32)props.getHeight() };
  73. gEyeAdaptHistogramParamDef.gHistogramParams.set(mParamBuffer, getHistogramScaleOffset(ppInfo));
  74. gEyeAdaptHistogramParamDef.gPixelOffsetAndSize.set(mParamBuffer, Vector4I(offsetAndSize));
  75. Vector2I threadGroupCount = getThreadGroupCount(target);
  76. gEyeAdaptHistogramParamDef.gThreadGroupCount.set(mParamBuffer, threadGroupCount);
  77. // Set output
  78. UINT32 numHistograms = threadGroupCount.x * threadGroupCount.y;
  79. mOutputDesc = POOLED_RENDER_TEXTURE_DESC::create2D(PF_FLOAT16_RGBA, HISTOGRAM_NUM_TEXELS, numHistograms,
  80. TU_LOADSTORE);
  81. // Dispatch
  82. ppInfo.histogramTex = GpuResourcePool::instance().get(mOutputDesc);
  83. mOutputTex.set(ppInfo.histogramTex->texture);
  84. RenderAPI& rapi = RenderAPI::instance();
  85. gRendererUtility().setComputePass(mMaterial);
  86. gRendererUtility().setPassParams(mParamsSet);
  87. rapi.dispatchCompute(threadGroupCount.x, threadGroupCount.y);
  88. mOutput = ppInfo.histogramTex->renderTexture;
  89. }
  90. void EyeAdaptHistogramMat::release(PostProcessInfo& ppInfo)
  91. {
  92. GpuResourcePool::instance().release(ppInfo.histogramTex);
  93. mOutput = nullptr;
  94. }
  95. Vector2I EyeAdaptHistogramMat::getThreadGroupCount(const SPtr<RenderTexture>& target)
  96. {
  97. const UINT32 texelsPerThreadGroupX = THREAD_GROUP_SIZE_X * LOOP_COUNT_X;
  98. const UINT32 texelsPerThreadGroupY = THREAD_GROUP_SIZE_Y * LOOP_COUNT_Y;
  99. const RenderTextureProperties& props = target->getProperties();
  100. Vector2I threadGroupCount;
  101. threadGroupCount.x = ((INT32)props.getWidth() + texelsPerThreadGroupX - 1) / texelsPerThreadGroupX;
  102. threadGroupCount.y = ((INT32)props.getHeight() + texelsPerThreadGroupY - 1) / texelsPerThreadGroupY;
  103. return threadGroupCount;
  104. }
  105. Vector2 EyeAdaptHistogramMat::getHistogramScaleOffset(const PostProcessInfo& ppInfo)
  106. {
  107. const StandardPostProcessSettings& settings = *ppInfo.settings;
  108. float diff = settings.autoExposure.histogramLog2Max - settings.autoExposure.histogramLog2Min;
  109. float scale = 1.0f / diff;
  110. float offset = -settings.autoExposure.histogramLog2Min * scale;
  111. return Vector2(scale, offset);
  112. }
  113. EyeAdaptHistogramReduceParamDef gEyeAdaptHistogramReduceParamDef;
  114. EyeAdaptHistogramReduceMat::EyeAdaptHistogramReduceMat()
  115. {
  116. mParamBuffer = gEyeAdaptHistogramReduceParamDef.createBuffer();
  117. mParamsSet->setParamBlockBuffer("Input", mParamBuffer);
  118. SPtr<GpuParams> params = mParamsSet->getGpuParams();
  119. params->getTextureParam(GPT_FRAGMENT_PROGRAM, "gHistogramTex", mHistogramTex);
  120. params->getTextureParam(GPT_FRAGMENT_PROGRAM, "gEyeAdaptationTex", mEyeAdaptationTex);
  121. }
  122. void EyeAdaptHistogramReduceMat::_initDefines(ShaderDefines& defines)
  123. {
  124. // Do nothing
  125. }
  126. void EyeAdaptHistogramReduceMat::execute(PostProcessInfo& ppInfo)
  127. {
  128. // Set parameters
  129. mHistogramTex.set(ppInfo.histogramTex->texture);
  130. SPtr<PooledRenderTexture> eyeAdaptationRT = ppInfo.eyeAdaptationTex[ppInfo.lastEyeAdaptationTex];
  131. SPtr<Texture> eyeAdaptationTex;
  132. if (eyeAdaptationRT != nullptr) // Could be that this is the first run
  133. eyeAdaptationTex = eyeAdaptationRT->texture;
  134. else
  135. eyeAdaptationTex = Texture::WHITE;
  136. mEyeAdaptationTex.set(eyeAdaptationTex);
  137. Vector2I threadGroupCount = EyeAdaptHistogramMat::getThreadGroupCount(ppInfo.downsampledSceneTex->renderTexture);
  138. UINT32 numHistograms = threadGroupCount.x * threadGroupCount.y;
  139. gEyeAdaptHistogramReduceParamDef.gThreadGroupCount.set(mParamBuffer, numHistograms);
  140. // Set output
  141. mOutputDesc = POOLED_RENDER_TEXTURE_DESC::create2D(PF_FLOAT16_RGBA, EyeAdaptHistogramMat::HISTOGRAM_NUM_TEXELS, 2,
  142. TU_RENDERTARGET);
  143. // Render
  144. ppInfo.histogramReduceTex = GpuResourcePool::instance().get(mOutputDesc);
  145. RenderAPI& rapi = RenderAPI::instance();
  146. rapi.setRenderTarget(ppInfo.histogramReduceTex->renderTexture, true);
  147. gRendererUtility().setPass(mMaterial);
  148. gRendererUtility().setPassParams(mParamsSet);
  149. Rect2 drawUV(0.0f, 0.0f, (float)EyeAdaptHistogramMat::HISTOGRAM_NUM_TEXELS, 2.0f);
  150. gRendererUtility().drawScreenQuad(drawUV);
  151. rapi.setRenderTarget(nullptr);
  152. mOutput = ppInfo.histogramReduceTex->renderTexture;
  153. }
  154. void EyeAdaptHistogramReduceMat::release(PostProcessInfo& ppInfo)
  155. {
  156. GpuResourcePool::instance().release(ppInfo.histogramReduceTex);
  157. mOutput = nullptr;
  158. }
  159. EyeAdaptationParamDef gEyeAdaptationParamDef;
  160. EyeAdaptationMat::EyeAdaptationMat()
  161. {
  162. mParamBuffer = gEyeAdaptationParamDef.createBuffer();
  163. mParamsSet->setParamBlockBuffer("Input", mParamBuffer);
  164. mParamsSet->getGpuParams()->getTextureParam(GPT_FRAGMENT_PROGRAM, "gHistogramTex", mReducedHistogramTex);
  165. }
  166. void EyeAdaptationMat::_initDefines(ShaderDefines& defines)
  167. {
  168. defines.set("THREADGROUP_SIZE_X", EyeAdaptHistogramMat::THREAD_GROUP_SIZE_X);
  169. defines.set("THREADGROUP_SIZE_Y", EyeAdaptHistogramMat::THREAD_GROUP_SIZE_Y);
  170. }
  171. void EyeAdaptationMat::execute(PostProcessInfo& ppInfo, float frameDelta)
  172. {
  173. bool texturesInitialized = ppInfo.eyeAdaptationTex[0] != nullptr && ppInfo.eyeAdaptationTex[1] != nullptr;
  174. if(!texturesInitialized)
  175. {
  176. POOLED_RENDER_TEXTURE_DESC outputDesc = POOLED_RENDER_TEXTURE_DESC::create2D(PF_FLOAT32_R, 1, 1, TU_RENDERTARGET);
  177. ppInfo.eyeAdaptationTex[0] = GpuResourcePool::instance().get(outputDesc);
  178. ppInfo.eyeAdaptationTex[1] = GpuResourcePool::instance().get(outputDesc);
  179. }
  180. ppInfo.lastEyeAdaptationTex = (ppInfo.lastEyeAdaptationTex + 1) % 2; // TODO - Do I really need two targets?
  181. // Set parameters
  182. mReducedHistogramTex.set(ppInfo.histogramReduceTex->texture);
  183. Vector2 histogramScaleAndOffset = EyeAdaptHistogramMat::getHistogramScaleOffset(ppInfo);
  184. const StandardPostProcessSettings& settings = *ppInfo.settings;
  185. Vector4 eyeAdaptationParams[3];
  186. eyeAdaptationParams[0].x = histogramScaleAndOffset.x;
  187. eyeAdaptationParams[0].y = histogramScaleAndOffset.y;
  188. float histogramPctHigh = Math::clamp01(settings.autoExposure.histogramPctHigh);
  189. eyeAdaptationParams[0].z = std::min(Math::clamp01(settings.autoExposure.histogramPctLow), histogramPctHigh);
  190. eyeAdaptationParams[0].w = histogramPctHigh;
  191. eyeAdaptationParams[1].x = std::min(settings.autoExposure.minEyeAdaptation, settings.autoExposure.maxEyeAdaptation);
  192. eyeAdaptationParams[1].y = settings.autoExposure.maxEyeAdaptation;
  193. eyeAdaptationParams[1].z = settings.autoExposure.eyeAdaptationSpeedUp;
  194. eyeAdaptationParams[1].w = settings.autoExposure.eyeAdaptationSpeedDown;
  195. eyeAdaptationParams[2].x = Math::pow(2.0f, settings.exposureScale);
  196. eyeAdaptationParams[2].y = frameDelta;
  197. eyeAdaptationParams[2].z = 0.0f; // Unused
  198. eyeAdaptationParams[2].w = 0.0f; // Unused
  199. gEyeAdaptationParamDef.gEyeAdaptationParams.set(mParamBuffer, eyeAdaptationParams[0], 0);
  200. gEyeAdaptationParamDef.gEyeAdaptationParams.set(mParamBuffer, eyeAdaptationParams[1], 1);
  201. gEyeAdaptationParamDef.gEyeAdaptationParams.set(mParamBuffer, eyeAdaptationParams[2], 2);
  202. // Render
  203. SPtr<PooledRenderTexture> eyeAdaptationRT = ppInfo.eyeAdaptationTex[ppInfo.lastEyeAdaptationTex];
  204. RenderAPI& rapi = RenderAPI::instance();
  205. rapi.setRenderTarget(eyeAdaptationRT->renderTexture, true);
  206. gRendererUtility().setPass(mMaterial);
  207. gRendererUtility().setPassParams(mParamsSet);
  208. gRendererUtility().drawScreenQuad();
  209. rapi.setRenderTarget(nullptr);
  210. }
  211. CreateTonemapLUTParamDef gCreateTonemapLUTParamDef;
  212. WhiteBalanceParamDef gWhiteBalanceParamDef;
  213. CreateTonemapLUTMat::CreateTonemapLUTMat()
  214. {
  215. mParamBuffer = gCreateTonemapLUTParamDef.createBuffer();
  216. mWhiteBalanceParamBuffer = gWhiteBalanceParamDef.createBuffer();
  217. mParamsSet->setParamBlockBuffer("Input", mParamBuffer);
  218. mParamsSet->setParamBlockBuffer("WhiteBalanceInput", mWhiteBalanceParamBuffer);
  219. SPtr<GpuParams> params = mParamsSet->getGpuParams();
  220. params->getLoadStoreTextureParam(GPT_COMPUTE_PROGRAM, "gOutputTex", mOutputTex);
  221. }
  222. void CreateTonemapLUTMat::_initDefines(ShaderDefines& defines)
  223. {
  224. defines.set("LUT_SIZE", LUT_SIZE);
  225. }
  226. void CreateTonemapLUTMat::execute(PostProcessInfo& ppInfo)
  227. {
  228. const StandardPostProcessSettings& settings = *ppInfo.settings;
  229. // Set parameters
  230. gCreateTonemapLUTParamDef.gGammaAdjustment.set(mParamBuffer, 2.2f / settings.gamma);
  231. // Note: Assuming sRGB (PC monitor) for now, change to Rec.709 when running on console (value 1), or to raw 2.2
  232. // gamma when running on Mac (value 2)
  233. gCreateTonemapLUTParamDef.gGammaCorrectionType.set(mParamBuffer, 0);
  234. Vector4 tonemapParams[2];
  235. tonemapParams[0].x = settings.tonemapping.filmicCurveShoulderStrength;
  236. tonemapParams[0].y = settings.tonemapping.filmicCurveLinearStrength;
  237. tonemapParams[0].z = settings.tonemapping.filmicCurveLinearAngle;
  238. tonemapParams[0].w = settings.tonemapping.filmicCurveToeStrength;
  239. tonemapParams[1].x = settings.tonemapping.filmicCurveToeNumerator;
  240. tonemapParams[1].y = settings.tonemapping.filmicCurveToeDenominator;
  241. tonemapParams[1].z = settings.tonemapping.filmicCurveLinearWhitePoint;
  242. tonemapParams[1].w = 0.0f; // Unused
  243. gCreateTonemapLUTParamDef.gTonemapParams.set(mParamBuffer, tonemapParams[0], 0);
  244. gCreateTonemapLUTParamDef.gTonemapParams.set(mParamBuffer, tonemapParams[1], 1);
  245. // Set color grading params
  246. gCreateTonemapLUTParamDef.gSaturation.set(mParamBuffer, settings.colorGrading.saturation);
  247. gCreateTonemapLUTParamDef.gContrast.set(mParamBuffer, settings.colorGrading.contrast);
  248. gCreateTonemapLUTParamDef.gGain.set(mParamBuffer, settings.colorGrading.gain);
  249. gCreateTonemapLUTParamDef.gOffset.set(mParamBuffer, settings.colorGrading.offset);
  250. // Set white balance params
  251. gWhiteBalanceParamDef.gWhiteTemp.set(mWhiteBalanceParamBuffer, settings.whiteBalance.temperature);
  252. gWhiteBalanceParamDef.gWhiteOffset.set(mWhiteBalanceParamBuffer, settings.whiteBalance.tint);
  253. // Set output
  254. POOLED_RENDER_TEXTURE_DESC outputDesc = POOLED_RENDER_TEXTURE_DESC::create3D(PF_R8G8B8A8,
  255. LUT_SIZE, LUT_SIZE, LUT_SIZE, TU_LOADSTORE);
  256. // Dispatch
  257. ppInfo.colorLUT = GpuResourcePool::instance().get(outputDesc);
  258. mOutputTex.set(ppInfo.colorLUT->texture);
  259. RenderAPI& rapi = RenderAPI::instance();
  260. gRendererUtility().setComputePass(mMaterial);
  261. gRendererUtility().setPassParams(mParamsSet);
  262. rapi.dispatchCompute(LUT_SIZE / 8, LUT_SIZE / 8, LUT_SIZE);
  263. }
  264. void CreateTonemapLUTMat::release(PostProcessInfo& ppInfo)
  265. {
  266. GpuResourcePool::instance().release(ppInfo.colorLUT);
  267. }
  268. TonemappingParamDef gTonemappingParamDef;
  269. template<bool GammaOnly, bool AutoExposure>
  270. TonemappingMat<GammaOnly, AutoExposure>::TonemappingMat()
  271. {
  272. mParamBuffer = gTonemappingParamDef.createBuffer();
  273. mParamsSet->setParamBlockBuffer("Input", mParamBuffer);
  274. SPtr<GpuParams> params = mParamsSet->getGpuParams();
  275. params->getTextureParam(GPT_VERTEX_PROGRAM, "gEyeAdaptationTex", mEyeAdaptationTex);
  276. params->getTextureParam(GPT_FRAGMENT_PROGRAM, "gInputTex", mInputTex);
  277. if(!GammaOnly)
  278. params->getTextureParam(GPT_FRAGMENT_PROGRAM, "gColorLUT", mColorLUT);
  279. }
  280. template<bool GammaOnly, bool AutoExposure>
  281. void TonemappingMat<GammaOnly, AutoExposure>::_initDefines(ShaderDefines& defines)
  282. {
  283. if(GammaOnly)
  284. defines.set("GAMMA_ONLY", 1);
  285. if (AutoExposure)
  286. defines.set("AUTO_EXPOSURE", 1);
  287. defines.set("LUT_SIZE", CreateTonemapLUTMat::LUT_SIZE);
  288. }
  289. template<bool GammaOnly, bool AutoExposure>
  290. void TonemappingMat<GammaOnly, AutoExposure>::execute(const SPtr<Texture>& sceneColor,
  291. const SPtr<RenderTarget>& outputRT, const Rect2& outputRect, PostProcessInfo& ppInfo)
  292. {
  293. gTonemappingParamDef.gRawGamma.set(mParamBuffer, 1.0f / ppInfo.settings->gamma);
  294. gTonemappingParamDef.gManualExposureScale.set(mParamBuffer, Math::pow(2.0f, ppInfo.settings->exposureScale));
  295. // Set parameters
  296. mInputTex.set(sceneColor);
  297. SPtr<Texture> colorLUT;
  298. if(ppInfo.colorLUT != nullptr)
  299. colorLUT = ppInfo.colorLUT->texture;
  300. mColorLUT.set(colorLUT);
  301. SPtr<Texture> eyeAdaptationTexture;
  302. if(ppInfo.eyeAdaptationTex[ppInfo.lastEyeAdaptationTex] != nullptr)
  303. eyeAdaptationTexture = ppInfo.eyeAdaptationTex[ppInfo.lastEyeAdaptationTex]->texture;
  304. mEyeAdaptationTex.set(eyeAdaptationTexture);
  305. // Render
  306. RenderAPI& rapi = RenderAPI::instance();
  307. rapi.setRenderTarget(outputRT);
  308. rapi.setViewport(outputRect);
  309. gRendererUtility().setPass(mMaterial);
  310. gRendererUtility().setPassParams(mParamsSet);
  311. gRendererUtility().drawScreenQuad();
  312. }
  313. template class TonemappingMat<true, true>;
  314. template class TonemappingMat<false, true>;
  315. template class TonemappingMat<true, false>;
  316. template class TonemappingMat<false, false>;
  317. void PostProcessing::postProcess(RendererCamera* viewInfo, const SPtr<Texture>& sceneColor, float frameDelta)
  318. {
  319. auto& viewProps = viewInfo->getProperties();
  320. PostProcessInfo& ppInfo = viewInfo->getPPInfo();
  321. const StandardPostProcessSettings& settings = *ppInfo.settings;
  322. SPtr<RenderTarget> finalRT = viewProps.target;
  323. Rect2 viewportRect = viewProps.nrmViewRect;
  324. bool hdr = viewProps.isHDR;
  325. if(hdr && settings.enableAutoExposure)
  326. {
  327. mDownsample.execute(sceneColor, ppInfo);
  328. mEyeAdaptHistogram.execute(ppInfo);
  329. mDownsample.release(ppInfo);
  330. mEyeAdaptHistogramReduce.execute(ppInfo);
  331. mEyeAdaptHistogram.release(ppInfo);
  332. mEyeAdaptation.execute(ppInfo, frameDelta);
  333. mEyeAdaptHistogramReduce.release(ppInfo);
  334. }
  335. if (hdr && settings.enableTonemapping)
  336. {
  337. if (ppInfo.settingDirty) // Rebuild LUT if PP settings changed
  338. mCreateLUT.execute(ppInfo);
  339. if (settings.enableAutoExposure)
  340. mTonemapping_AE.execute(sceneColor, finalRT, viewportRect, ppInfo);
  341. else
  342. mTonemapping.execute(sceneColor, finalRT, viewportRect, ppInfo);
  343. }
  344. else
  345. {
  346. if (hdr && settings.enableAutoExposure)
  347. mTonemapping_AE_GO.execute(sceneColor, finalRT, viewportRect, ppInfo);
  348. else
  349. mTonemapping_GO.execute(sceneColor, finalRT, viewportRect, ppInfo);
  350. }
  351. if (ppInfo.settingDirty)
  352. ppInfo.settingDirty = false;
  353. }
  354. }}