Notes Specific to the Web Version
Pass WebGL context, etc. to Renderer
To improve performance, CubismWebSamples refrains from using WebGL getters in the loop and passes them cached on the application side.
Frame buffer and viewport information must be passed to the renderer before drawing.
// Pass the canvas size let viewport: number = [ 0, 0, canvas.width, canvas.height ]; this.getRenderer().setRenderState(frameBuffer, viewport); this.getRenderer().drawModel();
Allocator, Memory-Related Description
Unlike the Native version, variables and objects that are no longer needed are freed by garbage collection and must be properly dereferenced.
The Web version requires UNPACK_PREMULTIPLY_ALPHA_WEBGL to be set to true when generating textures because the library’s drawing method is the Premultiplied method.