Version: 2019.2

Camera.OnRenderImage(RenderTexture,RenderTexture)

マニュアルに切り替える

説明

OnRenderImage はすべてのレンダリングが RenderImage へと完了したときに呼び出されます。

ポストプロセッシングエフェクト

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 your 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.

このメッセージはカメラにアタッチされているすべてのスクリプトに送られます。

See Also: Writing Post-Processing Effects.

using UnityEngine;

public class Example : MonoBehaviour { Material material;

void OnRenderImage(RenderTexture source, RenderTexture destination) { // Copy the source Render Texture to the destination, // applying the material along the way. Graphics.Blit(source, destination, material); } }