Graphics.BlitMultiTap 多重位块传送

static function BlitMultiTap (source : Texture, dest : RenderTexture, mat : Material, params offsets : Vector2[]) : void

Parameters参数

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像素偏移。

参见: Graphics.BlitMultiTap

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);
}
最后修改:2011年2月27日 Sunday 19:31

本脚本参考基于Unity 3.4.1f5

英文部分版权属©Unity公司所有,中文部分© Unity圣典 版权所有,未经许可,严禁转载 。