| With the vigorous development of the Internet industry, Web related technology became increasingly valuable. Graphics is the key element of an attractive Web application. But as the complexity of the web application increases, tranditional2D graphics have been unable to meet the needs of the application. Interactive3D graphics application is the answer to this problem. But early Web interactive3D graphics application has some defieciencies, such as Java applets can’t use graphics hardware acceleration, Flash and Silverlight technology need plug-in support.The emergence of the WebGL technology perfect solved these problems. WebGL is a new3D graphics API which adds a JavaScript binding to OpenGL ES2.0. WebGL provides3d rendering hardware acceleration for HTML5Canvas. So Web developers can use graphics hardware to display complex3D scenes and models more smoothly in the browsers which also provide the possibility for the development of high performance web-side interactive3D graphics applications.But direct use of the underlying WebGL interface for development is inefficiency, so we need to encapsulate WebGL functionality to provide users with a mechanism of middleware, and users need not to know details of WebGL to the develop rapidly of the Web interactive3D graphics applications. This middleware system is often referred to as3D graphics engine. The main work of this article is to study and implement WebGL-based3D graphics engine.This paper introduces the basic architecture of3D game engines, and then we discuss the most popular3D game engines and the related theories. Finally, we study the design and implementation of the WebGL based game engine, SimpleGL and analyse the advantages and disadvantages of the SimpleGL engine by comparison with other engines. This paper is composed of five parts:Part1, Introduction. Firstly, this part introduces the background of the WebGL technology emergency and the necessity for study and implementation of the WebGL-based3D graphics engine. Then we introduce the basic3D game engine architecture and modules, and the main function of each module. Secondly, it introduces the most popular3D game engines(such as commercial game engines: Quake family Engines and Unreal family Engines, and open source game engines: Irrlicht engine and Torque engine). Finally, it discusses the game engine development technology trends.Part2, Background. This part mainly introduces the3D game engine development related mathematical basis:including coordinate system and frame, homogeneous coordinate, the commonly used affine transformations(e.g., translation, scaling, rotation) and perspective projection technology, lighting technology (including parallel light, point light, ambient light, etc.). Then we introduce the WebGL rendering pipeline and shaders.Part3, The design and implementation of system. Firstly, this part introduces the basic architecture of SimpleGL engine, including scene graph module, resource management module, mesh module, game assets serialization module, textures and shaders module, input management module,3d model import module and math library. Secondly, it discusses the design and implementation of these modules, including the design principles, and the introduction of main methods and properties.Part4. System performance tests and analysis. This paper uses unique draw call, view volume culling and material change tests benchmark the performance of the SimpleGL engine. Advantages and disadvantages of SimpleGL engine are analyzed through comparing with the Three.js engine and Unity engine.Part5, Summary. Firstly, this part evaluates the design and implementation of the SimpleGL engine, and summarizes the work in this paper. And then we point out the merits and demerits of the design and implementation of the engine. And then, it suggests some improvements for the future of the engine (such as adds sound module, physics engine module, animation module, etc.). |