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

スクリプト言語

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

Graphics.Blit

public static function Blit(source: Texture, mat: Material, pass: int = -1): void;

Parameters

source コピー元の画像
dest コピー先の RenderTexture オブジェクト。 null の場合、直接画面に転送する
mat Material to use for copying. Material's shader could do some post-processing effect, for example.
pass If -1 (default), draws all passes in the material. Otherwise, draws given pass only.

Description

Texture型のデータをRenderTexrureへコピーする

This is mostly used for implementing image effects, and requires Unity Pro. Blit sets dest to be active render texture, sets source as _MainTex property on the material, and draws a full-screen quad. See Also: Graphics.BlitMultiTap, image effects.

	// Copies aTexture to rTex and displays it in all cameras.

	var aTexture : Texture;
	var rTex : RenderTexture;

	function Start() {
		if(!aTexture || !rTex)
			Debug.LogError("A texture or a render texture are missing, assign them.");
	}

	function Update () {
		Graphics.Blit (aTexture, rTex);
	}