Click or drag to resize
AB4D logo

SeparableKernelPostProcess Class

SeparableKernelPostProcess applies horizontal or vertical gaussian post process. It uses array of offsets and weights to define how the pixels are processed (size of the arrays is defined by the filterSize specified in the constructor - max value is 15). This post process usually needs to be rendered in two passes - one vertical and one horizontal.
Inheritance Hierarchy
SystemObject
  Ab3d.DirectXDXResourceBase
    Ab3d.DirectXSharedDXResource
      Ab3d.DirectXSharedDXDeviceResource
        Ab3d.DirectX.PostProcessingPostProcessBase
          Ab3d.DirectX.PostProcessingStandardPostProcess
            Ab3d.DirectX.PostProcessingSimplePixelShaderPostProcess
              Ab3d.DirectX.PostProcessingSeparableKernelPostProcess
                Ab3d.DirectX.PostProcessingDownSampleWithFilerPostProcess
                Ab3d.DirectX.PostProcessingGaussianBlurPostProcess

Namespace: Ab3d.DirectX.PostProcessing
Assembly: Ab3d.DXEngine (in Ab3d.DXEngine.dll) Version: 7.0.8865.1045
Syntax
C#
public abstract class SeparableKernelPostProcess : SimplePixelShaderPostProcess

The SeparableKernelPostProcess type exposes the following members.

Constructors
 NameDescription
Public methodSeparableKernelPostProcess(Int32) Initializes a new instance of the SeparableKernelPostProcess class.
Public methodSeparableKernelPostProcess(Boolean, Int32) Initializes a new instance of the SeparableKernelPostProcess class.
Top
Properties
 NameDescription
Public propertyFilterSize Gets the size of the filter - number of pixels that are read to get the color produces by this post-process.
Public propertyIsVerticalPass Gets a boolean that specifies if vertical rendering pass is applied. If false than horizontal pass is applied. This value is set in constructor. Note that in order to render this post process fully, it needs to run in two passes - once as vertical and once as horizontal post process.
Public propertyTextureSize Gets or sets the size of the texture.
Top
Methods
 NameDescription
Public methodRender Render renders the post process with using the sourceShaderResourceView as the source texture. It rendered the output to the CurrentRenderTargetView defined in the renderingContext.
(Overrides SimplePixelShaderPostProcessRender(RenderingContext, ShaderResourceView))
Top
Fields
 NameDescription
Public fieldMaxFilterSize MaxFilterSize defines the maximum filter size that is supported by this post-process.
Top
Remarks

SeparableKernelPostProcess applies horizontal or vertical gaussian blur post process. It uses array of offsets and weights to define how the pixels are processed.

Offsets define how far from the texture coordinate we sample pixel. Weights define how much weight this pixel has in the final color.

The following pixel shader is used for this post process:

C#
float4 output = (float4)0.0f;

for (int i = 0; i < 15; i++)
    output += gTexture.Sample(gSampler, psIn.textCoord + gOffsets[i]) * gWeights[i];

return output;
See Also