Class ImageExportBase
Wrapper to export a glTF image from one or more Unity textures
Inherited Members
Namespace: GLTFast.Export
Assembly: glTFast.Export.dll
Syntax
public abstract class ImageExportBase
Properties
FileName
Exported texture's file name
Declaration
public abstract string FileName { get; }
Property Value
Type | Description |
---|---|
string |
FilterMode
Source texture's filter mode
Declaration
public abstract FilterMode FilterMode { get; }
Property Value
Type | Description |
---|---|
FilterMode |
MimeType
Exported texture's mime type
Declaration
public abstract string MimeType { get; }
Property Value
Type | Description |
---|---|
string |
WrapModeU
Source texture's wrap mode (U direction)
Declaration
public abstract TextureWrapMode WrapModeU { get; }
Property Value
Type | Description |
---|---|
TextureWrapMode |
WrapModeV
Source texture's wrap mode (V direction)
Declaration
public abstract TextureWrapMode WrapModeV { get; }
Property Value
Type | Description |
---|---|
TextureWrapMode |
Methods
EncodeTexture(Texture2D, ImageFormat, bool, Material)
Encodes the export texture
Declaration
protected static byte[] EncodeTexture(Texture2D texture, ImageFormat format, bool hasAlpha = true, Material blitMaterial = null)
Parameters
Type | Name | Description |
---|---|---|
Texture2D | texture | Main texture to encode |
ImageFormat | format | Image format |
bool | hasAlpha | True if the texture has an alpha channel |
Material | blitMaterial | Custom blit material |
Returns
Type | Description |
---|---|
byte[] | Encoded texture data |
GetData()
Returns the exported and encoded texture data
Declaration
public abstract byte[] GetData()
Returns
Type | Description |
---|---|
byte[] | Encoded texture data. |
Write(string, bool)
Writes image file
Declaration
public abstract bool Write(string filePath, bool overwrite)
Parameters
Type | Name | Description |
---|---|---|
string | filePath | Destination file path |
bool | overwrite | If true, existing files will be overwritten |
Returns
Type | Description |
---|---|
bool | True if writing succeeded, false otherwise |