Skip to content

DualPostProcess

Chuck Walbourn edited this page Nov 14, 2018 · 8 revisions

Performs basic post-processing with a built-in set of shaders which operate using two input textures.

See also PostProcess

Header

#include "PostProcess.h"

Initialization

Construction requires a Direct3D 12 device, a shader selection parameter, and state description:

std::unique_ptr<DualPostProcess> postProcess;

RenderTargetState rtState(m_deviceResources->GetBackBufferFormat(),
    m_deviceResources->GetDepthBufferFormat());

postProcess = std::make_unique<DualPostProcess>(device, rtState, DualPostProcess::Merge);

For exception safety, it is recommended you make use of the C++ RAII pattern and use a std::unique_ptr or std::shared_ptr

Shader selection

DualPostProcess can be configured to use various pixel shaders when creating the instance:

  • Merge: Combines two images using provided weights.
  • BloomCombine: Combines the bloom texture produced by BasicPostProcess in a final pass with the original scene texture.

Properties

  • SetSourceTexture, SetSourceTexture2 is used to set the input texture as a Shader Resource View Descriptor.

  • SetMergeParameters is used to set the two weights for the Merge shader. Setting these to 0.5,0.5 will blend two images, while setting them both to 1.0 will add the two images together.

  • SetBloomCombineParameters sets the various parameters for the BloomCombine shader as the final pass of implementing a bloom effect.

For Use

  • Universal Windows Platform apps
  • Windows desktop apps
  • Windows 11
  • Windows 10
  • Xbox One
  • Xbox Series X|S

Architecture

  • x86
  • x64
  • ARM64

For Development

  • Visual Studio 2026
  • Visual Studio 2022 (17.12 or later)
  • clang/LLVM v12 - v21
  • MinGW 14.2, 15.2, 16.1
  • CMake 3.21

Related Projects

DirectX Tool Kit for DirectX 11

DirectXMesh

DirectXTex

DirectXMath

Tools

Test Suite

Model Viewer

Content Exporter

DxCapsViewer

See also

DirectX Landing Page

Clone this wiki locally