Home Reference Source
public class | source

Renderer

Extends:

GLBoostObject → Renderer

This class take a role as operator of rendering process. In order to render images to canvas, this Renderer class gathers other elements' data, decides a plan of drawing process, and then just execute it.

Constructor Summary

Public Constructor
public

constructor(glBoostContext: *, parameters: *)

Member Summary

Public Members
public get

glContext: *: webglcontext

Get WebGL context.

public get
public get
Private Members
private
private
private
private
private
private
private
private
private
private
private
private

Method Summary

Public Methods
public

clearCanvas(color_flg: boolean, depth_flg: boolean, stencil_flg: boolean)

clear color/depth/stencil of canvas.

public

async disableWebVR()

public

doConvenientRenderLoop(expression: *, beforeCallback: *, afterCallback: *, args: ...*)

public

doRenderLoop(renderLoopFunc: *, time: *, args: ...*)

This method treats the given callback function as a render loop and call it every frame.

public

draw(expression: Expression)

draw elements of the expression.

public

async enterWebVR(initialUserSittingPositionIfStageParametersDoNotExist: *, minRenderWidth: undefined, minRenderHeight: undefined): *

public

async exitWebVR()

public

async readyForWebVR(requestButtonDom: *): *

public

resize(width: number, height: number)

resize canvas and viewport.

public
public

update(expression: Expression)

update things of elements of the expression.

public
Private Methods
private

_clearBuffer(gl: *, renderPass: *)

private

_drawGizmos(gizmos: *, expression: *, lights: *, camera: *, renderPass: *, index: *, viewport: *, isDepthTest: *)

Inherited Summary

From class GLBoostObject
public static
private static
private static
public get
public get
public get

Return the simple class-specific number.

public get
public get
public get
public get
public get
public get
public set
private
private
private
private
private
private
private
private
private
private
public
public
public
public

Return instance name.

public
private

_copy(instance: *)

private

Public Constructors

public constructor(glBoostContext: *, parameters: *) source

Override:

GLBoostObject#constructor

Params:

NameTypeAttributeDescription
glBoostContext *
parameters *

Public Members

public get glContext: *: webglcontext source

Get WebGL context.

Return:

*

a context of WebGL

public get isReadyForWebVR: * source

public get isWebVRMode: * source

Private Members

private __animationFrameId: * source

private __animationFrameObject: * source

private __canvasHeightBackup: * source

private __canvasWidthBackup: * source

private __defaultUserSittingPositionInVR: * source

private __isReadyForWebVR: boolean source

private __isWebVRMode: boolean source

private __minRenderHeightFromUser: * source

private __minRenderWidthFromUser: * source

private __requestedToEnterWebVR: boolean source

private __webvrDisplay: * source

private __webvrFrameData: * source

Public Methods

public clearCanvas(color_flg: boolean, depth_flg: boolean, stencil_flg: boolean) source

clear color/depth/stencil of canvas.

Params:

NameTypeAttributeDescription
color_flg boolean

true: clear color, false: don't clear color

depth_flg boolean

true: clear depth, false: don't clear depth

stencil_flg boolean

true: clear stencil, false: don't clear stencil

public async disableWebVR() source

public doConvenientRenderLoop(expression: *, beforeCallback: *, afterCallback: *, args: ...*) source

Params:

NameTypeAttributeDescription
expression *
beforeCallback *
afterCallback *
args ...*

public doRenderLoop(renderLoopFunc: *, time: *, args: ...*) source

This method treats the given callback function as a render loop and call it every frame.

Params:

NameTypeAttributeDescription
renderLoopFunc *
time *
args ...*

public draw(expression: Expression) source

draw elements of the expression.

Params:

NameTypeAttributeDescription
expression Expression

a instance of Expression class

public async enterWebVR(initialUserSittingPositionIfStageParametersDoNotExist: *, minRenderWidth: undefined, minRenderHeight: undefined): * source

Params:

NameTypeAttributeDescription
initialUserSittingPositionIfStageParametersDoNotExist *
minRenderWidth undefined
  • optional
  • default: undefined
minRenderHeight undefined
  • optional
  • default: undefined

Return:

*

public async exitWebVR() source

public async readyForWebVR(requestButtonDom: *): * source

Params:

NameTypeAttributeDescription
requestButtonDom *

Return:

*

public resize(width: number, height: number) source

resize canvas and viewport.

Params:

NameTypeAttributeDescription
width number

width to resize.

height number

height to resize.

public stopRenderLoop() source

public update(expression: Expression) source

update things of elements of the expression.

Params:

NameTypeAttributeDescription
expression Expression

a instance of Expression class

public webVrSubmitFrame() source

Private Methods

private _clearBuffer(gl: *, renderPass: *) source

Params:

NameTypeAttributeDescription
gl *
renderPass *

private _drawGizmos(gizmos: *, expression: *, lights: *, camera: *, renderPass: *, index: *, viewport: *, isDepthTest: *) source

Params:

NameTypeAttributeDescription
gizmos *
expression *
lights *
camera *
renderPass *
index *
viewport *
isDepthTest *