用户工具

站点工具


侧边栏



Unity3D中文文档

script:unityengine:enumerations:textureformat:textureformat

TextureFormat 纹理格式

Description 描述

Format used when creating textures from scripts.

从脚本创建纹理时使用的格式。

C#:

using UnityEngine;
using System.Collections;
 
public class ExampleClass : MonoBehaviour {
    void Start() {
        Texture2D texture = new Texture2D(128, 128, TextureFormat.Alpha8, false);
        GetComponent<Renderer>().material.mainTexture = texture;
    }
}

javascript:

function Start () {
	// Create a new alpha-only texture and assign it
	// to the renderer's material
	var texture = new Texture2D (128, 128, TextureFormat.Alpha8, false);
	GetComponent.<Renderer>().material.mainTexture = texture;
}

Note that not all graphics cards support all texture formats, use SystemInfo.SupportsTextureFormat to check.

注意不是所有的显卡都支持纹理格式,使用systeminfo.supportstextureformat检查。

See Also: Texture2D, texture assets.

参见:Texture2D, texture assets.

Variables 变量

Alpha8Alpha-only texture format.
Alpha-只有的纹理格式。
ARGB4444A 16 bits/pixel texture format. Texture stores color with an alpha channel.
16位/像素的纹理格式。贮存彩色纹理的一个alpha通道。
RGB24A color texture format.
一个颜色纹理格式。
RGBA32Color with alpha texture format, 8-bits per channel.
颜色alpha纹理格式,8位每通道。
ARGB32Color with an alpha channel texture format.
颜色与alpha通道纹理格式。
RGB565A 16 bit color texture format.
16位颜色纹理格式。
R16A 16 bit color texture format that only has a red channel.
一个16位的颜色纹理格式,只有一个红色通道。
DXT1Compressed color texture format.
压缩颜色纹理格式。
DXT5Compressed color with alpha channel texture format.
压缩颜色和Alpha通道纹理格式。
RGBA4444Color and alpha texture format, 4 bit per channel.
颜色和alpha纹理格式,4位每个通道。
BGRA32Format returned by iPhone camera.
由苹果相机返回的格式。
RHalfScalar (R) texture format, 16 bit floating point.
标量(R)的纹理格式,16位浮点。
RGHalfTwo color (RG) texture format, 16 bit floating point per channel.
双色(RG)的纹理格式,每通道16位浮点。
RGBAHalfRGB color and alpha texture format, 16 bit floating point per channel.
RGB颜色和alpha纹理格式,每通道16位浮点。
RFloatScalar (R) texture format, 32 bit floating point.
标量(R)的纹理格式,32位浮点。
RGFloatTwo color (RG) texture format, 32 bit floating point per channel.
双色(RG)的纹理格式,每通道32位浮点。
RGBAFloatRGB color and alpha etxture format, 32-bit floats per channel.
RGB颜色和alpha纹理格式,每通道16位浮点。
YUY2A format that uses the YUV color space and is often used for video encoding. Currently, this texture format is only useful for native code plugins as there is no support for texture importing or pixel access for this format. YUY2 is implemented for Direct3D 9, Direct3D 11, and Xbox One.
一个格式,采用YUV颜色空间,通常用于视频编码。目前,这种纹理格式只用于本地代码插件,因为没有支持这种格式的纹理导入或像素访问。YUY2实现Direct3D 9,Direct3D 11和Xbox One。
DXT1CrunchedCompressed color texture format with crunch compression for small storage sizes.
用于小存储的紧缩压缩的压缩颜色纹理格式。
DXT5CrunchedCompressed color with alpha channel texture format with crunch compression for small storage sizes.
压缩颜色与Alpha通道的纹理格式与紧缩压缩的小存储尺寸。
PVRTC_RGB2PowerVR (iOS) 2 bits/pixel compressed color texture format.
PowerVR(IOS)2位/像素压缩纹理格式。
PVRTC_RGBA2PowerVR (iOS) 2 bits/pixel compressed with alpha channel texture format.
PowerVR(IOS)2位/像素的alpha通道的纹理压缩格式。
PVRTC_RGB4PowerVR (iOS) 4 bits/pixel compressed color texture format.
PowerVR(IOS)4位/像素压缩纹理格式。
PVRTC_RGBA4PowerVR (iOS) 4 bits/pixel compressed with alpha channel texture format.
PowerVR(IOS)4位/像素的alpha通道的纹理压缩格式。
ETC_RGB4ETC (GLES2.0) 4 bits/pixel compressed RGB texture format.
ETC(gles2.0)4位/像素的RGB纹理压缩格式。
ATC_RGB4ATC (ATITC) 4 bits/pixel compressed RGB texture format.
ATC(atitc)4位/像素的RGB纹理压缩格式。
ATC_RGBA8ATC (ATITC) 8 bits/pixel compressed RGB texture format.
ATC(atitc)8位/像素的RGB纹理压缩格式。
EAC_RETC2 / EAC (GL ES 3.0) 4 bits/pixel compressed unsigned single-channel texture format.
ETC2 / EAC (GL ES 3.0) 4位/像素压缩的无符号单通道纹理格式。
EAC_R_SIGNEDETC2 / EAC (GL ES 3.0) 4 bits/pixel compressed signed single-channel texture format.
ETC2 / EAC (GL ES 3.0) 4位/像素压缩的单通道的纹理格式。
EAC_RGETC2 / EAC (GL ES 3.0) 8 bits/pixel compressed unsigned dual-channel (RG) texture format.
ETC2 / EAC (GL ES 3.0) 8位/像素压缩无符号双通道(RG)的纹理格式。
EAC_RG_SIGNEDETC2 / EAC (GL ES 3.0) 8 bits/pixel compressed signed dual-channel (RG) texture format.
ETC2 / EAC (GL ES 3.0) 8位/像素压缩签署双通道(RG)的纹理格式。
ETC2_RGBETC2 (GL ES 3.0) 4 bits/pixel compressed RGB texture format.
ETC2 (GL ES 3.0) 4位/像素的RGB纹理压缩格式。
ETC2_RGBA1ETC2 (GL ES 3.0) 4 bits/pixel RGB+1-bit alpha texture format.
ETC2 (GL ES 3.0) 4位/像素的RGB + 1 alpha纹理格式。
ETC2_RGBA8ETC2 (GL ES 3.0) 8 bits/pixel compressed RGBA texture format.
ETC2 (GL ES 3.0) 8位/像素的RGBA纹理压缩格式。
ASTC_RGB_4x4ASTC (4×4 pixel block in 128 bits) compressed RGB texture format.
ASTC (4×4 128位像素块) 压缩RGB纹理格式。
ASTC_RGB_5x5ASTC (5×5 pixel block in 128 bits) compressed RGB texture format.
ASTC (5×5 128位像素块) 压缩RGB纹理格式。
ASTC_RGB_6x6ASTC (6×6 pixel block in 128 bits) compressed RGB texture format.
ASTC (6×6 128位像素块) 压缩RGB纹理格式。
ASTC_RGB_8x8ASTC (8×8 pixel block in 128 bits) compressed RGB texture format.
ASTC (8×8 128位像素块) 压缩RGB纹理格式。
ASTC_RGB_10x10ASTC (10×10 pixel block in 128 bits) compressed RGB texture format.
ASTC (10×10 128位像素块) 压缩RGB纹理格式。
ASTC_RGB_12x12ASTC (12×12 pixel block in 128 bits) compressed RGB texture format.
ASTC (12×12 128位像素块) 压缩RGB纹理格式。
ASTC_RGBA_4x4ASTC (4×4 pixel block in 128 bits) compressed RGBA texture format.
ASTC (4×4 128位像素块) 压缩RGBA纹理格式
ASTC_RGBA_5x5ASTC (5×5 pixel block in 128 bits) compressed RGBA texture format.
ASTC (5×5 128位像素块) 压缩RGBA纹理格式
ASTC_RGBA_6x6ASTC (6×6 pixel block in 128 bits) compressed RGBA texture format.
ASTC (6×6 128位像素块) 压缩RGBA纹理格式
ASTC_RGBA_8x8ASTC (8×8 pixel block in 128 bits) compressed RGBA texture format.
ASTC (8×8 128位像素块) 压缩RGBA纹理格式
ASTC_RGBA_10x10ASTC (10×10 pixel block in 128 bits) compressed RGBA texture format.
ASTC (10×10 128位像素块) 压缩RGBA纹理格式
ASTC_RGBA_12x12ASTC (12×12 pixel block in 128 bits) compressed RGBA texture format.
ASTC (12×12 128位像素块) 压缩RGBA纹理格式
ETC_RGB4_3DSETC 4 bits/pixel compressed RGB texture format.
ETC 4位/像素的RGB纹理压缩格式。
ETC_RGBA8_3DSETC 4 bits/pixel RGB + 4 bits/pixel Alpha compressed texture format.
ETC 4位/像素的RGB + 4位/像素的alpha压缩纹理格式。
script/unityengine/enumerations/textureformat/textureformat.txt · 最后更改: 2016/10/08 07:17 由 emjo