言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

Camera.OnRenderImage(RenderTexture,RenderTexture)

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual

Description

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

ポストプロセッシング エフェクト (Unity Pro のみ) シェーダーベースのフィルターで処理することによって最終的な画像を変更することが可能です。 入力される画像は source レンダーテクスチャです。 結果は最終的には destination レンダーテクスチャになります。カメラにアタッチされた複数の画像フィルタがある場合、 次のフィルタの source として最初のフィルターの destination を渡すことによって画像を順次処理します。 このメッセージはカメラにアタッチされている全てのスクリプトに送られます。 See Also: Unity Proで動作する イメージエフェクト

	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);
	}
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    public Material mat;
    void OnRenderImage(RenderTexture src, RenderTexture dest) {
        Graphics.Blit(src, dest, mat);
    }
}
import UnityEngine
import System.Collections

public class ExampleClass(MonoBehaviour):

	public mat as Material

	def OnRenderImage(src as RenderTexture, dest as RenderTexture) as void:
		Graphics.Blit(src, dest, mat)