Texture
Class | Type | Name | Interface Description |
---|---|---|---|
DataType | Enum | UBNorm F16 F32 | • Represents an 8-Bit unsigned normalized integer data type. • Represents a 16-bit floating-point data type. • Represents a 32-bit floating-point data type. |
FilterMipmap_Mode | Enum | None Nearest Linearest | • Do not use Mipmap. • Use the nearest neighbor sampling method. • Use the linear sampling method. |
FilterMode | Enum | Nears Linear | • Use the nearest neighbor sampling method. • Use the linear sampling method. |
InternalFormat | Enum | RGB8U RGBA8U RGB16F RGBA16F RGB32F RGBA32F | • Represents 8-bit unsigned integer in RGB format. • Represents an 8-bit unsigned integer in RGBA format. • Represents a 16-bit floating-point number in RGB format. • Represents a 16-bit floating-point number in RGBA format. • Represents a 32-bit floating-point number in RGB format. • Represents a 32-bit floating-point number in RGBA format. |
PixelFormat | Enum | RGB8Unorm RGB16SFloat RGBA16SFloat RGBA32SFloat RGBA32SFloat | • Represents 8-bit unsigned normalized integer in RGB format. • Represents an 8-bit unsigned normalized integer in RGBA format. • Represents a 16-bit floating-point number in RGB format. • Represents a 16-bit floating-point number in RGBA format. • Represents a 32-bit floating-point number in RGB format. • Represents a 32-bit floating-point number in RGBA format. |
WrapMode | Enum | Repeat Clamp Mirror | • Texture repeat mode. • Texture clamping mode. • Texture mirroring mode. |
Class | Type | Name | Interface Description |
---|---|---|---|
Texture | Variables | enableMipmap: boolean | • Function: Indicates whether Mipmap is enabled. |
Texture | Variables | filterMin: FilterMode | • Function: The minimum filtering mode of the texture. |
Texture | Variables | filterMag: FilterMode | • Function: The maximum filtering mode of the texture. |
Texture | Variables | filterMipmap: FilterMipmapMode | • Function: The Mipmap filtering mode of the texture. |
Texture | Variables | wrapMode: WrapMode | • Function: The wrapping mode of the texture. |
Texture | Variables | wrapModeS: WrapMode | • Function: The wrapping mode of the texture in the S direction. |
Texture | Variables | wrapModeT: WrapMode | • Function: The wrapping mode of the texture in the T direction. |
Texture | Variables | wrapModeR: WrapMode | • Function: The wrapping mode of the texture in the R direction. |
Texture | Variables | maxAnisotropy: number | • Function: The maximum anisotropic filtering value of the texture. |
Examples
enableMipmap: boolean
tex.enableMipmap = true
filterMin: FilterMode
tex.filterMin = APJS.FilterMode.Nears
filterMag: FilterMode
tex.filterMax = APJS.FilterMode.Nears
filterMipmap: FilterMipmapMode
tex.filterMipmap = APJS.FilterMipmapMode.None
wrapMode: WrapMode
tex.wrapMode = APJS.WrapMode.Repeat
wrapModeS: WrapMode
tex.wrapModeS = APJS.WrapMode.Repea
wrapModeT: WrapMode
tex.wrapModeT = APJS.WrapMode.Repeat
wrapModeR: WrapMode
tex.wrapModeR = APJS.WrapMode.Repeat
maxAnisotropy: number
tex.maxAnisotropy = 1
Use Case
@component()
export class NewBehaviourScript extends APJS.BasicScriptComponent {
private tex:Texture; // get texture in some way
onStart() {
const result = `enableMipmap: ${this.tex.enableMipmap}
filterMin: ${this.tex.filterMin}
filterMag: ${this.tex.filterMag}
filterMipmap: ${this.tex.filterMipmap}
wrapModeR: ${this.tex.wrapModeR}
wrapModeT: ${this.tex.wrapModeT}
wrapModeS: ${this.tex.wrapModeS}
maxAnisotropy: ${this.tex.maxAnisotropy}`
}
onUpdate(deltaTime: number) {
}
}
Class | Type | Name | Interface Description |
---|---|---|---|
Texture | Functions | getWidth(): number | • Function: Get the width of the texture. |
Texture | Functions | getHeight(): number | • Function: Get the height of the texture. |
Texture | Functions | getDepth(): number | • Function: Get the depth of the texture. |
Examples
getWidth(): number
let texture = new Texture();
let width = texture.getWidth();
getHeight(): number
let texture = new Texture();
let height = texture.getHeight();
getDepth(): number
let texture = new Texture();
let depth = texture.getDepth();
Use Case
@component()
export class NewBehaviourScript extends APJS.BasicScriptComponent {
private tex:Texture; // get texture in some way
onStart() {
const result = `${this.tex.getWidth()}x${this.tex.getHeight()}
Depth: ${this.tex.getDepth()}`;
}
onUpdate(deltaTime: number) {
}
}