Version: 2017.2

MonoBehaviour.OnRenderImage(RenderTexture,RenderTexture)

切换到手册

描述

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.

当摄像机附加了多个图像过滤器时, 它们按顺序依照下述方法对图像进行处理:将第一个过滤器的目标作为源传递给下一个过滤器,依此类推。

该消息将发送到附加到摄像机的所有脚本。

另请参阅:编写后期处理效果

var mat: Material;

function OnRenderImage(src: RenderTexture, dest: RenderTexture) { // Copy the source Render Texture to the destination, // applying the material along the way. Graphics.Blit(src, dest, mat); }