OnRenderImage 在图像的所有渲染操作全部完成后调用。
后期处理效果。
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.
当摄像机附加了多个图像过滤器时,
它们按顺序依照下述方法对图像进行处理:将第一个过滤器的目标作为源传递给下一个过滤器,依此类推。
该消息将发送到附加到摄像机的所有脚本。
See Also: Writing Image Effects.
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour {
public Material mat;
void OnRenderImage(RenderTexture src, RenderTexture dest) {
Graphics.Blit(src, dest, mat);
}
}