Skip to content

@simversus/yjvisDocs


@simversus/yjvis / Texture

Class: Texture

纹理

Extends

Constructors

new Texture()

new Texture(): Texture

Returns

Texture

Inherited from

BaseObject.constructor

Defined in

core/baseObject.ts:112

Properties

anisotropy

anisotropy: number = 0

各向异性

Defined in

scene/Texture.ts:100


classHierarchy

classHierarchy: ClassEnum[]

Deprecated

Inherited from

BaseObject.classHierarchy

Defined in

core/baseObject.ts:96


flipY

flipY: boolean = false

是否翻转Y

Defined in

scene/Texture.ts:60


format

format: Format = Format.RGB8

纹理格式

Defined in

scene/Texture.ts:72


gfxTexure

gfxTexure: Texture

Internal

Defined in

scene/Texture.ts:56


height

height: number = 0

纹理高度

Defined in

scene/Texture.ts:112


label

label: string

自定义标识

Inherited from

BaseObject.label

Defined in

core/baseObject.ts:104


magFilter

magFilter: Filter = Filter.LINEAR

放大采样

Defined in

scene/Texture.ts:80


mapping

mapping: TexureMapping = TexureMapping.UVMapping

映射方式

Defined in

scene/Texture.ts:64


minFilter

minFilter: Filter = Filter.LINEAR

缩小采样

Defined in

scene/Texture.ts:76


mipFilter

mipFilter: Filter = Filter.LINEAR

mipmap采样

Defined in

scene/Texture.ts:84


mipmapLevel

mipmapLevel: number = 1

mipmap级别

Defined in

scene/Texture.ts:104


source

source: TextureSource[] = []

纹理数据

Defined in

scene/Texture.ts:117


type

type: TextureType = TextureType.TEX2D

纹理类型

Defined in

scene/Texture.ts:68


userData

userData: any

用户自定义数据

Inherited from

BaseObject.userData

Defined in

core/baseObject.ts:100


uuid

uuid: number

唯一标识符

Inherited from

BaseObject.uuid

Defined in

core/baseObject.ts:92


width

width: number = 0

纹理宽度

Defined in

scene/Texture.ts:108


wrapR

wrapR: Address = Address.WRAP

深度方向寻址

Defined in

scene/Texture.ts:96


wrapS

wrapS: Address = Address.WRAP

水平方向寻址

Defined in

scene/Texture.ts:88


wrapT

wrapT: Address = Address.WRAP

垂直方向寻址

Defined in

scene/Texture.ts:92

Accessors

isCompressed

get isCompressed(): boolean

Internal

是否可以压缩

Returns

boolean

Defined in

scene/Texture.ts:125


mtime

get mtime(): number

Returns

number

Inherited from

BaseObject.mtime

Defined in

core/baseObject.ts:118


samplerInfo

get samplerInfo(): SamplerInfo

Internal

采样器信息

Returns

SamplerInfo

Defined in

scene/Texture.ts:133

Methods

changed()

changed(): void

标记对象为已修改

Returns

void

Inherited from

BaseObject.changed

Defined in

core/baseObject.ts:128


is()

is(t): boolean

Parameters

t: ClassEnum

Returns

boolean

Inherited from

BaseObject.is

Defined in

core/baseObject.ts:122


release()

release(): void

销毁该对象

Returns

void

Overrides

BaseObject.release

Defined in

scene/Texture.ts:204


setSourceURL()

setSourceURL(url): Promise<void>

设置纹理的资源路径并立即下载,如果传入的是数组,则必须包含六个元素,此时纹理为立方体贴图

Parameters

url: string | string[]

Returns

Promise<void>

Defined in

scene/Texture.ts:149


update()

update(): void

Internal

将纹理数据写入GPU

Returns

void

Defined in

scene/Texture.ts:177