Skip to content

@simversus/yjvisDocs


@simversus/yjvis / Renderer

Class: Renderer

Internal

基础对象

Extends

Constructors

new Renderer()

new Renderer(props): Renderer

Parameters

props: Partial<object> = {}

Returns

Renderer

Overrides

BaseObject.constructor

Defined in

Renderer.ts:199

Properties

classHierarchy

classHierarchy: ClassEnum[]

Deprecated

Inherited from

BaseObject.classHierarchy

Defined in

core/baseObject.ts:96


debugData

debugData: object = {}

cpuExecuteTimeInFrame?

optional cpuExecuteTimeInFrame: number

在渲染帧中执行js的耗时

hasRenderJobInCurrentFrame?

optional hasRenderJobInCurrentFrame: boolean

当前帧是否有渲染任务

Defined in

Renderer.ts:95


label

label: string

自定义标识

Inherited from

BaseObject.label

Defined in

core/baseObject.ts:104


mainScene?

optional mainScene: Scene

Internal

Defined in

Renderer.ts:112


renderOPs

renderOPs: RenderOP[]

Internal

Defined in

Renderer.ts:108


useOITPass

useOITPass: boolean = false

是否使用oit渲染透明物体

Defined in

Renderer.ts:93


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


mainWindow

static mainWindow: RenderWindow

Defined in

Renderer.ts:52


outputColorSpace

static outputColorSpace: ColorSpace = ColorSpace.SRGBColorSpace

Defined in

Renderer.ts:64


shadowSetting

static shadowSetting: object

enabled

enabled: boolean = false

type

type: ShadowType = ShadowType.Basic

Defined in

Renderer.ts:59


toneMapping

static toneMapping: ToneMapping = ToneMapping.None

色调映射

Defined in

Renderer.ts:57

Accessors

dpr

get dpr(): number

渲染器dpr

Returns

number

Defined in

Renderer.ts:183


frameIdx

get frameIdx(): number

当前帧序号

Returns

number

Defined in

Renderer.ts:195


gpuDeviceInfo

get gpuDeviceInfo(): string

gpu设备信息

Returns

string

Defined in

Renderer.ts:156


gpuMemory

get gpuMemory(): MemoryStatus

gpu内存占用

Returns

MemoryStatus

Defined in

Renderer.ts:149


lineNum

get lineNum(): number

最新帧绘制线段数

Returns

number

Defined in

Renderer.ts:170


mtime

get mtime(): number

Returns

number

Inherited from

BaseObject.mtime

Defined in

core/baseObject.ts:118


size

get size(): Number2

视图尺寸

Returns

Number2

Defined in

Renderer.ts:189


slot

get slot(): HTMLElement

渲染器的容器

Returns

HTMLElement

Defined in

Renderer.ts:177


triangleNum

get triangleNum(): number

最新帧绘制三角形数

Returns

number

Defined in

Renderer.ts:163


version

get version(): string

渲染器版本

Returns

string

Defined in

Renderer.ts:142

Methods

changed()

changed(): void

标记对象为已修改

Returns

void

Inherited from

BaseObject.changed

Defined in

core/baseObject.ts:128


closeStatusPanel()

closeStatusPanel(): void

关闭统计面板

Returns

void

Defined in

Renderer.ts:266


getFpsHandler()

getFpsHandler(): () => number

获取一个获取fps的函数

Returns

Function

Returns

number

Defined in

Renderer.ts:298


is()

is(t): boolean

Parameters

t: ClassEnum

Returns

boolean

Inherited from

BaseObject.is

Defined in

core/baseObject.ts:122


openStatusPanel()

openStatusPanel(): void

打开统计面板

Returns

void

Defined in

Renderer.ts:251


registerFrameCallback()

registerFrameCallback(cb): () => FrameCallBack[]

注册animationFrame回调

Parameters

cb: FrameCallBack

Returns

Function

取消注册函数

Returns

FrameCallBack[]

Defined in

Renderer.ts:323


release()

release(): void

释放资源

Returns

void

Overrides

BaseObject.release

Defined in

Renderer.ts:274


setSize()

setSize(width, height): void

设置渲染尺寸

Parameters

width: number

height: number

Returns

void

Defined in

Renderer.ts:286


createMainWindow()

static createMainWindow(): void

Internal

创建主窗口

Returns

void

Defined in

Renderer.ts:70