Graphics.Blitstatic function Blit (source : Texture, dest : RenderTexture) : voidstatic function Blit (source : Texture, dest : RenderTexture, mat : Material, pass : int = -1) : voidParameters
DescriptionCopies source texture into destination render texture. This is mostly used for implementing image effects. 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.
JavaScripts
// 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); } using UnityEngine;
using System.Collections; public class example : MonoBehaviour { public Texture aTexture; public RenderTexture rTex; void Start() { if (!aTexture || !rTex) Debug.LogError("A texture or a render texture are missing, assign them."); } void Update() { Graphics.Blit(aTexture, rTex); } } import UnityEngine
import System.Collections class example(MonoBehaviour): public aTexture as Texture public rTex as RenderTexture def Start(): if (not aTexture) or (not rTex): Debug.LogError('A texture or a render texture are missing, assign them.') def Update(): Graphics.Blit(aTexture, rTex)
|
