BsPostProcessing.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsRenderBeastPrerequisites.h"
  5. #include "BsRendererMaterial.h"
  6. #include "BsParamBlocks.h"
  7. #include "BsGpuResourcePool.h"
  8. #include "BsStandardPostProcessSettings.h"
  9. namespace bs { namespace ct
  10. {
  11. /** @addtogroup RenderBeast
  12. * @{
  13. */
  14. /** Contains per-camera data used by post process effects. */
  15. struct PostProcessInfo
  16. {
  17. SPtr<StandardPostProcessSettings> settings;
  18. bool settingDirty = true;
  19. SPtr<PooledRenderTexture> downsampledSceneTex;
  20. SPtr<PooledRenderTexture> histogramTex;
  21. SPtr<PooledRenderTexture> histogramReduceTex;
  22. SPtr<PooledRenderTexture> eyeAdaptationTex[2];
  23. SPtr<PooledRenderTexture> colorLUT;
  24. INT32 lastEyeAdaptationTex = 0;
  25. };
  26. BS_PARAM_BLOCK_BEGIN(DownsampleParamDef)
  27. BS_PARAM_BLOCK_ENTRY_ARRAY(Vector2, gOffsets, 4)
  28. BS_PARAM_BLOCK_END
  29. extern DownsampleParamDef gDownsampleParamDef;
  30. /**
  31. * Shader that downsamples a texture to half its size.
  32. *
  33. * @tparam Quality 0 for a 2x2 filtered sample, 1 or higher for 4x4 filtered sample
  34. * @tparam MSAA True if the input texture is multi-sampled. Only first sample will be used, the rest will be
  35. * discarded.
  36. */
  37. template<int Quality, bool MSAA>
  38. class DownsampleMat : public RendererMaterial<DownsampleMat<Quality, MSAA>>
  39. {
  40. RMAT_DEF("PPDownsample.bsl");
  41. public:
  42. DownsampleMat();
  43. /** Renders the post-process effect with the provided parameters. */
  44. void execute(const SPtr<Texture>& target, PostProcessInfo& ppInfo);
  45. /** Releases the output render target. */
  46. void release(PostProcessInfo& ppInfo);
  47. /** Returns the render texture where the output will be written. */
  48. SPtr<RenderTexture> getOutput() const { return mOutput; }
  49. private:
  50. SPtr<GpuParamBlockBuffer> mParamBuffer;
  51. GpuParamTexture mInputTexture;
  52. POOLED_RENDER_TEXTURE_DESC mOutputDesc;
  53. SPtr<RenderTexture> mOutput;
  54. };
  55. /** Contains all variations of the DownsampleMat material. */
  56. class DownsampleMaterials
  57. {
  58. public:
  59. /**
  60. * Executes the appropriate downsampling material.
  61. *
  62. * @param[in] quality Determines quality of the downsampling filer. Specify 0 to use a 2x2 filter block, and
  63. * 1 or higher for a 4x4 filter block.
  64. * @param[in] msaa If true the input texture is assumed to have multiple samples. The downsampling shader
  65. * will discard all samples except the first one.
  66. * @param[in] target Texture to downsample.
  67. * @param[in] ppInfo Information about the current post processing pass.
  68. */
  69. void execute(UINT32 quality, bool msaa, const SPtr<Texture>& target, PostProcessInfo& ppInfo);
  70. /**
  71. * Releases any resources allocated by execute(). Must be called using the same @p quality and @p msaa parameters as
  72. * the corresponding execute() call. @see execute().
  73. */
  74. void release(UINT32 quality, bool msaa, PostProcessInfo& ppInfo);
  75. private:
  76. DownsampleMat<0, false> m0_NoMSAA;
  77. DownsampleMat<0, true> m0_MSAA;
  78. DownsampleMat<1, false> m1_NoMSAA;
  79. DownsampleMat<1, true> m1_MSAA;
  80. };
  81. BS_PARAM_BLOCK_BEGIN(EyeAdaptHistogramParamDef)
  82. BS_PARAM_BLOCK_ENTRY(Vector4I, gPixelOffsetAndSize)
  83. BS_PARAM_BLOCK_ENTRY(Vector2, gHistogramParams)
  84. BS_PARAM_BLOCK_ENTRY(Vector2I, gThreadGroupCount)
  85. BS_PARAM_BLOCK_END
  86. extern EyeAdaptHistogramParamDef gEyeAdaptHistogramParamDef;
  87. /** Shader that creates a luminance histogram used for eye adaptation. */
  88. class EyeAdaptHistogramMat : public RendererMaterial<EyeAdaptHistogramMat>
  89. {
  90. RMAT_DEF("PPEyeAdaptHistogram.bsl");
  91. public:
  92. EyeAdaptHistogramMat();
  93. /** Executes the post-process effect with the provided parameters. */
  94. void execute(PostProcessInfo& ppInfo);
  95. /** Releases the output render target. */
  96. void release(PostProcessInfo& ppInfo);
  97. /** Returns the render texture where the output was written. */
  98. SPtr<RenderTexture> getOutput() const { return mOutput; }
  99. /** Calculates the number of thread groups that need to execute to cover the provided render target. */
  100. static Vector2I getThreadGroupCount(const SPtr<RenderTexture>& target);
  101. /**
  102. * Returns a vector containing scale and offset (in that order) that will be applied to luminance values
  103. * to determine their position in the histogram.
  104. */
  105. static Vector2 getHistogramScaleOffset(const PostProcessInfo& ppInfo);
  106. static const UINT32 THREAD_GROUP_SIZE_X = 8;
  107. static const UINT32 THREAD_GROUP_SIZE_Y = 8;
  108. static const UINT32 HISTOGRAM_NUM_TEXELS = (THREAD_GROUP_SIZE_X * THREAD_GROUP_SIZE_Y) / 4;
  109. private:
  110. SPtr<GpuParamBlockBuffer> mParamBuffer;
  111. GpuParamTexture mSceneColor;
  112. GpuParamLoadStoreTexture mOutputTex;
  113. POOLED_RENDER_TEXTURE_DESC mOutputDesc;
  114. SPtr<RenderTexture> mOutput;
  115. static const UINT32 LOOP_COUNT_X = 8;
  116. static const UINT32 LOOP_COUNT_Y = 8;
  117. };
  118. BS_PARAM_BLOCK_BEGIN(EyeAdaptHistogramReduceParamDef)
  119. BS_PARAM_BLOCK_ENTRY(int, gThreadGroupCount)
  120. BS_PARAM_BLOCK_END
  121. extern EyeAdaptHistogramReduceParamDef gEyeAdaptHistogramReduceParamDef;
  122. /** Shader that reduces the luminance histograms created by EyeAdaptHistogramMat into a single histogram. */
  123. class EyeAdaptHistogramReduceMat : public RendererMaterial<EyeAdaptHistogramReduceMat>
  124. {
  125. RMAT_DEF("PPEyeAdaptHistogramReduce.bsl");
  126. public:
  127. EyeAdaptHistogramReduceMat();
  128. /** Executes the post-process effect with the provided parameters. */
  129. void execute(PostProcessInfo& ppInfo);
  130. /** Releases the output render target. */
  131. void release(PostProcessInfo& ppInfo);
  132. /** Returns the render texture where the output was written. */
  133. SPtr<RenderTexture> getOutput() const { return mOutput; }
  134. private:
  135. SPtr<GpuParamBlockBuffer> mParamBuffer;
  136. GpuParamTexture mHistogramTex;
  137. GpuParamTexture mEyeAdaptationTex;
  138. POOLED_RENDER_TEXTURE_DESC mOutputDesc;
  139. SPtr<RenderTexture> mOutput;
  140. };
  141. BS_PARAM_BLOCK_BEGIN(EyeAdaptationParamDef)
  142. BS_PARAM_BLOCK_ENTRY_ARRAY(Vector4, gEyeAdaptationParams, 3)
  143. BS_PARAM_BLOCK_END
  144. extern EyeAdaptationParamDef gEyeAdaptationParamDef;
  145. /** Shader that computes the eye adaptation value based on scene luminance. */
  146. class EyeAdaptationMat : public RendererMaterial<EyeAdaptationMat>
  147. {
  148. RMAT_DEF("PPEyeAdaptation.bsl");
  149. public:
  150. EyeAdaptationMat();
  151. /** Executes the post-process effect with the provided parameters. */
  152. void execute(PostProcessInfo& ppInfo, float frameDelta);
  153. private:
  154. SPtr<GpuParamBlockBuffer> mParamBuffer;
  155. GpuParamTexture mReducedHistogramTex;
  156. };
  157. BS_PARAM_BLOCK_BEGIN(CreateTonemapLUTParamDef)
  158. BS_PARAM_BLOCK_ENTRY_ARRAY(Vector4, gTonemapParams, 2)
  159. BS_PARAM_BLOCK_ENTRY(float, gGammaAdjustment)
  160. BS_PARAM_BLOCK_ENTRY(int, gGammaCorrectionType)
  161. BS_PARAM_BLOCK_ENTRY(Vector3, gSaturation)
  162. BS_PARAM_BLOCK_ENTRY(Vector3, gContrast)
  163. BS_PARAM_BLOCK_ENTRY(Vector3, gGain)
  164. BS_PARAM_BLOCK_ENTRY(Vector3, gOffset)
  165. BS_PARAM_BLOCK_END
  166. extern CreateTonemapLUTParamDef gCreateTonemapLUTParamDef;
  167. BS_PARAM_BLOCK_BEGIN(WhiteBalanceParamDef)
  168. BS_PARAM_BLOCK_ENTRY(float, gWhiteTemp)
  169. BS_PARAM_BLOCK_ENTRY(float, gWhiteOffset)
  170. BS_PARAM_BLOCK_END
  171. extern WhiteBalanceParamDef gWhiteBalanceParamDef;
  172. /**
  173. * Shader that creates a 3D lookup texture that is used to apply tonemapping, color grading, white balancing and gamma
  174. * correction.
  175. */
  176. class CreateTonemapLUTMat : public RendererMaterial<CreateTonemapLUTMat>
  177. {
  178. RMAT_DEF("PPCreateTonemapLUT.bsl");
  179. public:
  180. CreateTonemapLUTMat();
  181. /** Executes the post-process effect with the provided parameters. */
  182. void execute(PostProcessInfo& ppInfo);
  183. /** Releases the output render target. */
  184. void release(PostProcessInfo& ppInfo);
  185. /** Size of the 3D color lookup table. */
  186. static const UINT32 LUT_SIZE = 32;
  187. private:
  188. SPtr<GpuParamBlockBuffer> mParamBuffer;
  189. SPtr<GpuParamBlockBuffer> mWhiteBalanceParamBuffer;
  190. GpuParamLoadStoreTexture mOutputTex;
  191. };
  192. BS_PARAM_BLOCK_BEGIN(TonemappingParamDef)
  193. BS_PARAM_BLOCK_ENTRY(float, gRawGamma)
  194. BS_PARAM_BLOCK_ENTRY(float, gManualExposureScale)
  195. BS_PARAM_BLOCK_ENTRY(int, gNumSamples)
  196. BS_PARAM_BLOCK_END
  197. extern TonemappingParamDef gTonemappingParamDef;
  198. /** Shader that applies tonemapping and converts a HDR image into a LDR image. */
  199. template<bool GammaOnly, bool AutoExposure, bool MSAA>
  200. class TonemappingMat : public RendererMaterial<TonemappingMat<GammaOnly, AutoExposure, MSAA>>
  201. {
  202. RMAT_DEF("PPTonemapping.bsl");
  203. public:
  204. TonemappingMat();
  205. /** Executes the post-process effect with the provided parameters. */
  206. void execute(const SPtr<Texture>& sceneColor, const SPtr<RenderTarget>& outputRT, const Rect2& outputRect,
  207. PostProcessInfo& ppInfo);
  208. private:
  209. SPtr<GpuParamBlockBuffer> mParamBuffer;
  210. GpuParamTexture mInputTex;
  211. GpuParamTexture mColorLUT;
  212. GpuParamTexture mEyeAdaptationTex;
  213. };
  214. /** Container for all variations of the TonemappingMat material. */
  215. class TonemappingMaterials
  216. {
  217. public:
  218. /**
  219. * Finds a valid tonemapping material according to the requested parameters and executes it.
  220. *
  221. * @param[in] gammaOnly If true no color correction, white balancing or curve tonemapping will take place.
  222. * Instead the image will only be scaled by the exposure value and gamma corrected.
  223. * @param[in] autoExposure If true, the automatically calculated eye-adapatation exposure value will be used
  224. * as the exposure scale. If false, the user provided value will be used instead.
  225. * @param[in] MSAA True if the input texture has multiple samples. This will ensure that the samples
  226. * are resolved properly into a non-MSAA output texture.
  227. * @param[in] sceneColor Texture to apply tonemapping to.
  228. * @param[in] outputRT Render target to write the results to.
  229. * @param[in] outputRect Normalized rectangle determining to which part of the output texture to write to.
  230. * @param[in] ppInfo Information about the current post processing pass.
  231. */
  232. void execute(bool gammaOnly, bool autoExposure, bool MSAA, const SPtr<Texture>& sceneColor,
  233. const SPtr<RenderTarget>& outputRT, const Rect2& outputRect, PostProcessInfo& ppInfo);
  234. private:
  235. TonemappingMat<false, false, false> mFFF;
  236. TonemappingMat<false, false, true> mFFT;
  237. TonemappingMat<false, true, false> mFTF;
  238. TonemappingMat<false, true, true> mFTT;
  239. TonemappingMat<true, false, false> mTFF;
  240. TonemappingMat<true, false, true> mTFT;
  241. TonemappingMat<true, true, false> mTTF;
  242. TonemappingMat<true, true, true> mTTT;
  243. };
  244. const int MAX_BLUR_SAMPLES = 128;
  245. BS_PARAM_BLOCK_BEGIN(GaussianBlurParamDef)
  246. BS_PARAM_BLOCK_ENTRY_ARRAY(Vector2, gSampleOffsets, MAX_BLUR_SAMPLES)
  247. BS_PARAM_BLOCK_ENTRY_ARRAY(float, gSampleWeights, MAX_BLUR_SAMPLES)
  248. BS_PARAM_BLOCK_ENTRY(int, gNumSamples)
  249. BS_PARAM_BLOCK_END
  250. extern GaussianBlurParamDef gGaussianBlurParamDef;
  251. /** Shader that performs Gaussian blur filtering on the provided texture. */
  252. class GaussianBlurMat : public RendererMaterial<GaussianBlurMat>
  253. {
  254. // Direction of the Gaussian filter pass
  255. enum Direction
  256. {
  257. DirVertical,
  258. DirHorizontal
  259. };
  260. RMAT_DEF("PPGaussianBlur.bsl");
  261. public:
  262. GaussianBlurMat();
  263. /**
  264. * Renders the post-process effect with the provided parameters.
  265. *
  266. * @param[in] source Input texture to blur.
  267. * @param[in] filterSize Size of the blurring filter, in percent of the source texture. In range [0, 1].
  268. * @param[in] destination Output texture to which to write the blurred image to.
  269. */
  270. void execute(const SPtr<Texture>& source, float filterSize, const SPtr<RenderTexture>& destination);
  271. private:
  272. /** Calculates weights and offsets for the standard distribution of the specified filter size. */
  273. static UINT32 calcStdDistribution(float filterRadius, std::array<float, MAX_BLUR_SAMPLES>& weights,
  274. std::array<float, MAX_BLUR_SAMPLES>& offsets);
  275. /** Calculates the radius of the blur kernel depending on the source texture size and provided scale. */
  276. static float calcKernelRadius(const SPtr<Texture>& source, float scale, Direction filterDir);
  277. SPtr<GpuParamBlockBuffer> mParamBuffer;
  278. GpuParamTexture mInputTexture;
  279. };
  280. BS_PARAM_BLOCK_BEGIN(GaussianDOFParamDef)
  281. BS_PARAM_BLOCK_ENTRY(float, gNearBlurPlane)
  282. BS_PARAM_BLOCK_ENTRY(float, gFarBlurPlane)
  283. BS_PARAM_BLOCK_ENTRY(float, gInvNearBlurRange)
  284. BS_PARAM_BLOCK_ENTRY(float, gInvFarBlurRange)
  285. BS_PARAM_BLOCK_ENTRY(Vector2, gHalfPixelOffset)
  286. BS_PARAM_BLOCK_END
  287. extern GaussianDOFParamDef sGaussianDOFParamDef;
  288. /** Common interface for all variations of GaussianDOFSeparateMat. */
  289. class IGaussianDOFSeparateMat
  290. {
  291. public:
  292. virtual ~IGaussianDOFSeparateMat() { }
  293. /**
  294. * Renders the post-process effect with the provided parameters.
  295. *
  296. * @param[in] color Input color texture to process.
  297. * @param[in] depth Input depth buffer texture that will be used for determining pixel depth.
  298. * @param[in] view View through which the depth of field effect is viewed.
  299. * @param[in] settings Settings used to control depth of field rendering.
  300. */
  301. virtual void execute(const SPtr<Texture>& color, const SPtr<Texture>& depth, const RendererView& view,
  302. const DepthOfFieldSettings& settings) = 0;
  303. /**
  304. * Returns the texture generated after the shader was executed. Only valid to call this in-between calls to
  305. * execute() & release(), with @p idx value 0 or 1.
  306. */
  307. virtual SPtr<PooledRenderTexture> getOutput(UINT32 idx) = 0;
  308. /**
  309. * Releases the interally allocated output render textures. Must be called after each call to execute(), when the
  310. * caller is done using the textures.
  311. */
  312. virtual void release() = 0;
  313. };
  314. /**
  315. * Shader that masks pixels from the input color texture into one or two output textures. The masking is done by
  316. * determining if the pixel falls into near or far unfocused plane, as determined by depth-of-field parameters. User
  317. * can pick whether to output pixels just on the near plane, just on the far plane, or both.
  318. *
  319. * @tparam Near If true, near plane pixels are output to the first render target.
  320. * @tparam Far If true, far plane pixels are output to the first render target. If @p Near is also enabled, the
  321. * pixels are output to the second render target instead.
  322. */
  323. template<bool Near, bool Far>
  324. class GaussianDOFSeparateMat : public IGaussianDOFSeparateMat, public RendererMaterial<GaussianDOFSeparateMat<Near, Far>>
  325. {
  326. RMAT_DEF("PPGaussianDOFSeparate.bsl");
  327. public:
  328. GaussianDOFSeparateMat();
  329. /** @copydoc IGaussianDOFSeparateMat::execute() */
  330. void execute(const SPtr<Texture>& color, const SPtr<Texture>& depth, const RendererView& view,
  331. const DepthOfFieldSettings& settings) override;
  332. /** @copydoc IGaussianDOFSeparateMat::getOutput() */
  333. SPtr<PooledRenderTexture> getOutput(UINT32 idx) override;
  334. /** @copydoc IGaussianDOFSeparateMat::release() */
  335. void release() override;
  336. private:
  337. SPtr<GpuParamBlockBuffer> mParamBuffer;
  338. GpuParamTexture mColorTexture;
  339. GpuParamTexture mDepthTexture;
  340. SPtr<PooledRenderTexture> mOutput0;
  341. SPtr<PooledRenderTexture> mOutput1;
  342. };
  343. /** Common interface for all variations of GaussianDOFCombineMat. */
  344. class IGaussianDOFCombineMat
  345. {
  346. public:
  347. virtual ~IGaussianDOFCombineMat() { }
  348. /**
  349. * Renders the post-process effect with the provided parameters.
  350. *
  351. * @param[in] focused Input texture containing focused (default) scene color.
  352. * @param[in] near Input texture containing filtered (blurred) values for the unfocused foreground area.
  353. * Can be null if no near plane needs to be blended.
  354. * @param[in] far Input texture containing filtered (blurred) values for the unfocused background area.
  355. * Can be null if no far plane needs to be blended.
  356. * @param[in] depth Input depth buffer texture that will be used for determining pixel depth.
  357. * @param[in} output Texture to output the results to.
  358. * @param[in] view View through which the depth of field effect is viewed.
  359. * @param[in] settings Settings used to control depth of field rendering.
  360. */
  361. virtual void execute(const SPtr<Texture>& focused, const SPtr<Texture>& near, const SPtr<Texture>& far,
  362. const SPtr<Texture>& depth, const SPtr<RenderTarget>& output, const RendererView& view,
  363. const DepthOfFieldSettings& settings) = 0;
  364. };
  365. /**
  366. * Shader that combines pixels for near unfocused, focused and far unfocused planes, as calculated by
  367. * GaussianDOFSeparateMat. Outputs final depth-of-field filtered image.
  368. *
  369. * @tparam Near If true, near plane pixels are read from the near plane texture, otherwise near plane is assumed
  370. * not to exist.
  371. * @tparam Far If true, far plane pixels are read from the far plane texture, otherwise far plane is assumed not
  372. * to exist.
  373. */
  374. template<bool Near, bool Far>
  375. class GaussianDOFCombineMat : public IGaussianDOFCombineMat, public RendererMaterial<GaussianDOFCombineMat<Near, Far>>
  376. {
  377. RMAT_DEF("PPGaussianDOFCombine.bsl");
  378. public:
  379. GaussianDOFCombineMat();
  380. void execute(const SPtr<Texture>& focused, const SPtr<Texture>& near, const SPtr<Texture>& far,
  381. const SPtr<Texture>& depth, const SPtr<RenderTarget>& output, const RendererView& view,
  382. const DepthOfFieldSettings& settings) override;
  383. private:
  384. SPtr<GpuParamBlockBuffer> mParamBuffer;
  385. GpuParamTexture mFocusedTexture;
  386. GpuParamTexture mNearTexture;
  387. GpuParamTexture mFarTexture;
  388. GpuParamTexture mDepthTexture;
  389. };
  390. /** Performs Gaussian depth of field effect with the help of various related shaders. */
  391. class GaussianDOF
  392. {
  393. public:
  394. /**
  395. * Executes the depth of field effect on the provided scene color texture.
  396. *
  397. * @param[in] sceneColor Input texture containing scene color.
  398. * @param[in] sceneDepth Input depth buffer texture that will be used for determining pixel depth.
  399. * @param[in} output Texture to output the results to.
  400. * @param[in] view View through which the depth of field effect is viewed.
  401. * @param[in] settings Settings used to control depth of field rendering.
  402. */
  403. void execute(const SPtr<Texture>& sceneColor, const SPtr<Texture>& sceneDepth, const SPtr<RenderTarget>& output,
  404. const RendererView& view, const DepthOfFieldSettings& settings);
  405. /** Checks does the depth of field effect need to execute. */
  406. static bool requiresDOF(const DepthOfFieldSettings& settings);
  407. private:
  408. GaussianDOFSeparateMat<true, true> mSeparateNF;
  409. GaussianDOFSeparateMat<false, true> mSeparateF;
  410. GaussianDOFSeparateMat<true, false> mSeparateN;
  411. GaussianDOFCombineMat<true, true> mCombineNF;
  412. GaussianDOFCombineMat<false, true> mCombineF;
  413. GaussianDOFCombineMat<true, false> mCombineN;
  414. GaussianBlurMat mBlur;
  415. };
  416. /**
  417. * Renders post-processing effects for the provided render target.
  418. *
  419. * @note Core thread only.
  420. */
  421. class PostProcessing : public Module<PostProcessing>
  422. {
  423. public:
  424. /**
  425. * Renders post-processing effects for the provided render target. Resolves provided scene color texture into the
  426. * view's final output render target. Once the method exits, final render target is guaranteed to be currently
  427. * bound for rendering.
  428. */
  429. void postProcess(RendererView* viewInfo, const SPtr<RenderTargets>& renderTargets, float frameDelta);
  430. private:
  431. DownsampleMaterials mDownsample;
  432. EyeAdaptHistogramMat mEyeAdaptHistogram;
  433. EyeAdaptHistogramReduceMat mEyeAdaptHistogramReduce;
  434. EyeAdaptationMat mEyeAdaptation;
  435. CreateTonemapLUTMat mCreateLUT;
  436. TonemappingMaterials mTonemapping;
  437. GaussianDOF mGaussianDOF;
  438. };
  439. /** @} */
  440. }}