Table of Contents

Class SeparablePostProcess<TShaderProperties>

Namespace
Gamelogic.Fx.BuiltIn.PostProcessing
Assembly
Gamelogic.Fx.BuiltIn.dll

Encapsulates a post process based on a separable filter, such as a box blur.

[Version(1, 1, 0)]
[ExecuteInEditMode]
public class SeparablePostProcess<TShaderProperties> : SeparablePostProcess, IPostProcess where TShaderProperties : SeparableShaderProperties

Type Parameters

TShaderProperties
Inheritance
GLMonoBehaviour
SeparablePostProcess<TShaderProperties>
Implements
Derived
Inherited Members
GLMonoBehaviour.FindObjectsOfInterface<TInterface>()
GLMonoBehaviour.FindRequiredObjectOfType<T>()
GLMonoBehaviour.GetRequiredComponent<T>()
GLMonoBehaviour.GetRequiredComponentInChildren<T>()
MonoBehaviour.IsInvoking()
MonoBehaviour.StopCoroutine(Coroutine)
MonoBehaviour.StopAllCoroutines()
MonoBehaviour.runInEditMode
Component.GetComponent<T>()
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren<T>()
Component.GetComponentsInParent<T>()
Component.transform
Component.gameObject
Component.tag
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.name
Object.hideFlags

Remarks

An effect is separable if it can be implemented as two passes, one in the horizontal direction and one in the vertical, such as box blur or Gaussian blur.

To implement a new separable post process effect

  1. Define a new class (for example, BlurProperties that extends from SeparableShaderProperties and override the relevant methods and properties.
  2. Define BlurPostProcess that extends from SeparablePostProcess{BlurProperties}

You can then use BlurPostProcess like any other post process.

Methods

OnDisable()

public void OnDisable()

OnEnable()

public void OnEnable()

OnRenderImage(RenderTexture, RenderTexture)

The function that performs the post process effect.

public virtual void OnRenderImage(RenderTexture sourceTexture, RenderTexture destTexture)

Parameters

sourceTexture RenderTexture

The full screen source texture.

destTexture RenderTexture

The render target for the post process.

Remarks

A typical implementation uses UnityEngine.Graphics.Blit(UnityEngine.Texture, UnityEngine.RenderTexture, UnityEngine.Material) to perform the post-process effect.

OnValidate()

public void OnValidate()

SetMaterialProperties(Material)

Sets the shader-specific properties on the effect material before each pass.

protected virtual void SetMaterialProperties(Material effectMaterial)

Parameters

effectMaterial Material

The material to configure.

Remarks

Implementors should override this method to set the shader's specific properties.

The method is called twice, once for each direction. The direction vector is automatically set to (1, 0) for the first pass and (0, 1) for the second pass, and so are the kernel properties: KernelSize, KernelOffset, JumpSize.

Start()

public void Start()