Graphics.BlitMultiTap 多重位块传送
static function BlitMultiTap (source : Texture, dest : RenderTexture, mat : Material, params offsets : Vector2[]) : void
Parameters参数
-
sourceSource texture.
源纹理 -
destDestination RenderTexture, or null to blit directly to screen.
目标渲染纹理,或为null,blit直接到屏幕上。 -
matMaterial to use for copying. Material's shader should do some post-processing effect.
用于拷贝的材质。材质的着色器可以做一些后期效果。 -
offsetsVariable number of filtering offsets. Offsets are given in pixels.
过滤偏移的可变数字。偏移是给定的像素数。
Description描述
Copies source texture into destination, for multi-tap shader.
拷贝源纹理到目的渲染纹理,用于multi-tap着色器。
This is mostly used for implementing some image effects. For example, Gaussian or iterative Cone blurring samples source texture at multiple different locations.
这主要是用于实现图像效果。例如,高斯或迭代锥形模糊取样源纹理在多个不同的位置。
BlitMultiTap sets dest to be active render texture, sets source as _MainTex property on the material, and draws a full-screen quad. Each vertex of the quad has multiple texture coordinates set up, offset by offsets pixels.
BlitMultiTap设置dest到激活的渲染纹理,在材质上设置source作为_MainTex属性,并且绘制一个全屏方块,方块的每个点有多个纹理坐标,通过offsets像素偏移。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public Texture aTexture;
public RenderTexture rTex;
void Start() {
if (!typeof(aTexture) || !typeof(rTex))
Debug.LogError("A texture or a render texture are missing, assign them.");
}
void Update() {
Graphics.Blit(aTexture, rTex);
}
}
// Copies aTexture to rTex and displays it in all cameras.
//拷贝aTexture到rTex并显示它在所有相机
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);
}