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

スクリプト言語

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

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

public function RenderTexture(width: int, height: int, depth: int, format: RenderTextureFormat, readWrite: RenderTextureReadWrite)
public RenderTexture(int width, int height, int depth, RenderTextureFormat format, RenderTextureReadWrite readWrite);
public def RenderTexture(width as int, height as int, depth as int, format as RenderTextureFormat, readWrite as RenderTextureReadWrite)

Parameters

width ピクセル単位でのテクスチャ幅
height ピクセル単位でのテクスチャ高さ
depth デプスバッファのビット数
format ピクセル情報でのデータ形式
readWrite ピクセルデータの読み取り/書き込みは有効化されたか?

Description

新規の RenderTexture オブジェクトを作成します

レンダーテクスチャは width かける height のサイズで、 depth ビットの デプスバッファ(デプスは 0, 16, または 24)つきで、 format 形式かつ sRGB 読取 / 書込 を有効化 / 無効化して作成できます。 RenderTexture オブジェクトの作成により、ハードウェア表現が直ちに作成されないことに留意して下さい。 実際のレンダーテクスチャは最初の使用時、または Create が呼び出し時に作成されます。 このためレンダーテクスチャ作成時に format, isCubemap 等々、追加の変数をセットすることが出来ます。 See Also: format variable, GetTemporary.

var rt: RenderTexture;

function Start () {
	rt = new RenderTexture(256, 256, 16, RenderTextureFormat.ARGB32);
}
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    public RenderTexture rt;
    void Start() {
        rt = new RenderTexture(256, 256, 16, RenderTextureFormat.ARGB32);
    }
}
import UnityEngine
import System.Collections

public class ExampleClass(MonoBehaviour):

	public rt as RenderTexture

	def Start() as void:
		rt = RenderTexture(256, 256, 16, RenderTextureFormat.ARGB32)

Description