OnRenderImage is called after all rendering is complete to render image.
Postprocessing effects.
It allows you to modify final image by processing it with shader based filters.
The incoming image is source
render texture. The result should end up in
destination
render texture. You must always issue a Graphics.Blit or render a fullscreen quad if you override this method.
When there are multiple image filters attached to the camera,
they process image sequentially, by passing first filter's destination as the source to the next filter.
This message is sent to all scripts attached to the camera.
See Also: Writing Post-Processing Effects.
#pragma strict public var mat: Material; function OnRenderImage(src: RenderTexture, dest: RenderTexture) { // applying the material along the way. Graphics.Blit(src, dest, mat); }
using UnityEngine;
public class ExampleClass : MonoBehaviour { public Material mat;
void OnRenderImage(RenderTexture src, RenderTexture dest) { // Copy the source Render Texture to the destination, // applying the material along the way. Graphics.Blit(src, dest, mat); } }