WebGLRenderer
Projection renderer, based on WebGL
class WebGLRenderer
Properties
Width / height ratio (= width / height)
Canvas element
Canvas's height (devicePixelRatio
is not applied)
Current devicePixelRatio
value.
Canvas's width (devicePixelRatio
is not applied)
Methods
Destroy instance and release all resources.
Render projection
Render VR frame, only used for rendering frames inside VR sessions.
Resize canvas and renew inner size cache.
Constructor
new WebGLRenderer(canvas: HTMLCanvasElement, debug: boolean): WebGLRenderer
Parameters
HTMLCanvasElement
Canvas element
boolean
Whether to enable WebGL debugging
Properties
ctx
ctxWebGLContext
aspect
aspectnumber
Width / height ratio (= width / height)
const aspect = view360.renderer.width / view360.renderer.pixelRatio;
assert(aspect === view360.renderer.aspect);
canvas
canvasHTMLCanvasElement
Canvas element
height
heightnumber
Canvas's height (devicePixelRatio
is not applied)
pixelRatio
pixelRationumber
Current devicePixelRatio
value.
cosnt renderingWidth = view360.renderer.width * view360.renderer.pixelRatio;
width
widthnumber
Canvas's width (devicePixelRatio
is not applied)
Methods
destroy
destroyvoid
destroy(): void
Destroy instance and release all resources.
render
rendervoid
render(mesh: TriangleMesh<CommonProjectionUniforms>, camera: Camera): void
Render projection
Parameters
TriangleMesh<CommonProjectionUniforms>
renderVR
renderVRvoid
renderVR(mesh: TriangleMesh<CommonProjectionUniforms>, vr: XRManager, frame: XRFrame): void
Render VR frame, only used for rendering frames inside VR sessions.
Parameters
TriangleMesh<CommonProjectionUniforms>
Triangle mesh to render
Instance of XRManager
XRFrame
VR frame
resize
resizevoid
resize(): void
Resize canvas and renew inner size cache.