The difference between WebGL and canvas rendering methods Webkit

Laya engine supports WebGL and canvas two rendering methods, you can choose the rendering method when the engine is initialized

Laya.init(width,height,WebGL);//WebGL mode

Laya.init(width,height);//canvas defaults to canvas mode

Canvas is an H5 tag, which is used to draw pictures on web pages, but only supports 2D, not 3D. WebGL is a 3D drawing standard. WebGL supports 3D and has better performance than canvas . So now all WebGL can use WebGL, and some projects use canvas because some mobile phones do not support WebGL.

OpenGL is the underlying driver-level graphics interface (which is directly related to the graphics card), similar to DirectX,
but this underlying OpenGL is parasitic to the browser and cannot be involved in JavaScript,
but in order to allow the Web to have more powerful graphics processing capabilities in 2010 WebGL was introduced.
WebGL allows engineers to use JS to call the partially encapsulated OpenGL ES2.0 standard interface to provide hardware-level 3D graphics acceleration.

The relationship between the three: JavaScript -> WebGL -> OpenGL ->... -> graphics card and the final rendered graphics are presented to Canvas

So, the premise is able to use WebGL browser supports WebGL, and video card supports OpenGL ES2.0 can

How to build a WebGL program and use some simple WebGL related functions

Guess you like

Origin blog.csdn.net/u013321328/article/details/105573568