Version: 2017.3

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); }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961