お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。
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.
Closewidth | ピクセル単位でのテクスチャ幅 |
height | ピクセル単位でのテクスチャ高さ |
depth | デプスバッファのビット数 |
format | ピクセル情報でのデータ形式 |
readWrite | ピクセルデータの読み取り/書き込みは有効化されたか? |
新規の 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)