Link: http://www.cppblog.com/rise-worlds/archive/2009/04/22/80691.aspx
Introduction
:
Gamebyro is a mature commercial engine that has been used by many successful commercial projects. It not only includes well-known cross-platform standalone games such as civilization 4, elder brother scroll 4, and radiation 3, but also
EA's large 3dmmorpg warehouse hammer online. Gamebyro is completely designed based on the face object and has a clear structure for ease of use and expansion. Flexible programmable rendering architecture makes it easier to support
The latest graphics technology. On the other hand, due to its emphasis on versatility, gamebyro does not provide much support for upper-layer applications. Most of its tools and plug-ins only have some general functions, so it is more like a game.
Development Kit instead of a complete framework.
Engine Features Overview:
· Cross-platform (PC, xbox360, PS3)
· The scenario chart is in a hierarchical structure.
· Integration with major modeling tools (supported by plug-ins)
· Efficient visibility Cutting
· Supports advanced 3D hardware acceleration on all platforms
· Advanced textures and coloring Effects
· Dynamic Collision Detection
· Classification of details (dashboard)
· Flexible rendering, sorting, and cropping Algorithms
Object System
:
Gamebyro's object system is used throughout the engine. It mainly implements functions such as object management, reference counting, and object lifetime. You can use the object system by inheriting several base classes.
Its main features include:
1. smart pointer (reference count)
2. runtime class recognition (rtti)
3. Scenario object Replication
4. serialization (Object docalization)
5. object naming
6. Management of object Extension Data
7. Timer (mainly used for animation)
8. Multithreading
Driver Layer
:
Gamebyro encapsulates graphic interfaces and extracts graphic APIs from the rendering system of the engine. on PC systems, gamebyro supports both DX9 and dx10 interfaces.
DX9
Renderer features
:
L gamebyro does not allow multiple dx9renderer objects to exist simultaneously and cannot coexist with dx10renderer. However, in the same frame, the dx9renderer of gamebyro can render multiple windows at the same time.
L gamebyro's DX9 Renderer supports multi-threaded resource access and resource pre-loading. However, multithreading is still strictly restricted.
L dx9renderer's fixed pipeline skin Operation supports at least four bones (matrices), and shader-based skin Operation supports 30 bones.
L dx9renderer supports full-screen anti-aliasing through multi-sampling of the backend buffer, ranging from 2 to 4 times.
L
In DX9, most hardware imposes a certain limit on the number of illumination received by a single piece of the ry (a batch of rendering). If this limit is exceeded, gamebyro will
Or the impact factors give up some light. For this reason, in an application, when more than eight vertices shine on the same object, some will be discarded.
L dx9renderer provides the Left and Right reverse features of the viewport for rearview mirror and cube surface rendering.
L dx9renderer supports vertex fog. You can set the maximum value of fog through related interfaces.
L dx9renderer fully supports DX texture format. Applications can convert their direct3d
Textures is provided to gamebyro. The engine automatically encapsulates it into its own material object and allows you to add attributes and special effects. By providing its own DX texture format, gamebyro
Correct use of self-unsupported texture formats.
L texture-related features and restrictions: dx9renderer requires the video card to support at least two textures in the same pass; otherwise, the Renderer will not be created successfully. In addition, limited by hardware features include:
1. cube mapping (cube texture)
2. specular bump mapping)
3. Diffuse bump mapping)
4. Non-power-of-two texture size (NLE-length non-integer-power texture): This texture has the following restrictions: the texture addressing mode must be set to clamp, and mipmapping cannot be used.
5. Texture downsizing (reduced texture accuracy)
6. Texture
Compression (compressed texture), dx9renderer supports loading compressed texture formats, and provides instant texture compression. If the hardware supports compression
>.
7. Texture apply modes supported: dx9renderer does not support apply_decal texture application mode.
8. Texture format requests (texture format requirements): precise texture pixel ing depends on the target hardware and display pixel bit width.
9. palettized texture formats (supported by the color palette texture format ).
10. sphere mapping: All Renderer in gamebyro supports sphere ing in the world space.
11. dx9renderer supports loading files in the DDS, TGA, and BMP formats. Both cube textures and volume textures can be correctly loaded, but they can only be addressed through 3D coordinates.
12. The gamebyro Editor supports exporting DX textures in the original format without format conversion during loading. Send the texture in DX format to DX for processing.
Engine Rendering System Analysis
Gamebyro rendering is controlled by the frame rendering system (rendering system). The frame rendering system encapsulates the rendering process of each batch, so that the entire rendering process can be conveniently controlled.
Shadow system:
Gamebyro's shadow system is a model of frame rendering system. It implements flexible shadow rendering by extending the existing classes in an inherited way. Gamebyro supports the generation of shadow graphs of three types of light sources, including the point light source (full-direction light), parallel light, and spotlight.
The shadow system is controlled by a single manager. Shadow algorithms are encapsulated into class objects. There are several shadow technologies in the system at the same time, that is, you can choose to use or use them at the same time.
Several shadow techniques apply to the same ry. The shadow system will automatically crop the light sources without shadow receiver, and when calculating the shadows produced by each light source, it will crop the ry not affected by this light source.
To achieve performance optimization. Users can easily extend the shadow system to implement their own shadow algorithms.
Gamebyro's shadow is mainly based on the shadowmap technology. The point light source uses a cube shadow, while the soft shadow uses the variance shadow (VSM) technology ).
Gamebyro's shadow system is integrated into the scenario editor. You can directly specify the shadow effect for the light source in the editor. What you see is what you get, which improves development efficiency.
(Use the Soft Shadows generated by both the point light shadow and the direction light in the editor)
Terrain system:
The terrain of gamebyro is easy to use and can be easily expanded to meet other functional requirements of the project.
A terrain system consists of the following parts:
1. niterraincomponent: it is the entrance to the entire terrain system. With terrain interactor, you can access all the sub-component of niterraincomponent just like accessing the container.
2. Terrain interactor terrain iterator, through terrain
Interactor can start all data queries, such as simple collision detection, meta-data query, height graph import and file loading. Almost all operations based on the terrain System
All operations are completed through terrain interactor.
3. niterrainsectorcomponent
Contains a quad-tree responsible for organizing terrain data blocks. This object is responsible for loading and performing Ray Intersection queries between objects and terrain from disks, converting terrain ry, and managing internal resources (including shared vertex streams and
Shader ). At the same time, niterrainsectorcomponent is also responsible for the occlusion query of the quad-tree and the generation of visible sets.
4. Data leaves and blocks
The level of splitting is set by niterraincomponent. each node in the tree contains a terrain block. The side length of the block must be an integer power of 2. Level of the root node of the quad-tree
If the value is n and the leaf node is 0, the details are increased from the height to the bottom. If the level is 0, the terrain block contained in the leaf node has the highest details.
5. material layers: the terrain system uses a mask to specify materials for the terrain. Mask data specifies the material corresponding to each part of the surface. A single earth surface supports up to four materials, which are mixed based on their respective weights. The weight data is also obtained through masks.
Materials play a special role in the terrain rendering system. You can specify meta-data for the materials to attach other information (such as the sound of walking in the snow ), you can also add vertices or pixel coloring programs to the surface by texture textures. In addition, each texture can contain the following specified texture textures:
L diffuse/base map reflection textures use 3 or 4 channels to determine the color of reflected light.
L detail map detail texture, which provides the Alpha value for the reflection texture.
L normal map normal texture.
L parallax map, used to save the height offset information of the surface pixel.
Gamebyro also provides simple terrain Ray tracking and surface rendering. The current implementation of topographic ray tracing is very simple. It is to use a Ray to query the surface triangle.
Physics is integrated to support collision detection between objects and the Earth through the physical engine L. Water surface rendering is mainly composed of two texture animations, which express water waves through concave and convex textures. Where the engine is located
To save the height of the surface from the water surface. Two colors are pre-defined: the deep water color and the light water color. If there is no surface below the water surface, the deep water color is used directly. In the pixel shadow
The height chart can be sampled to obtain the depth of the current pixel, and then the difference between the dark color and the light color is obtained based on the depth to obtain the final color of the water. However, this effect is not ideal.
You also need to expand it, for example, adding reflection and refraction.
Material
:
Gamebyro mainly uses the 3dmax plug-in to edit materials and provides standard material nodes.
(In gamebyro, the main function of the material node is to generate the corresponding shader code according to the coloring process.) This node has a total of nine channels and provides a large number of adjustable channels.
This allows art to easily use pixel-by-pixel illumination, Parallax pasters, and environment pasters. In the game, gamebyro is compiled based on different material attributes and different lighting environments.
Different shader codes are saved in binary format on the disk and loaded into the memory at the next startup, so that repeated compilation is not required, but there will be some latency when you first enter the game. Flexible and powerful Materials
Gamebyro is flexible in this regard as an important feature of the generation engine. However, art still cannot use visual tools to control the material processing process. It can only edit resources and parameters, but is not highly editable.
Large.
Shader
:
Gamebyro provides a highly scalable shader system that is closely integrated with artistic creation tools. Gamebyro defines its own shader
Text-based. nsf files and binary-based. NSB file ,. NSF file generated after compilation. NSB file, which can be completed during development or runtime.
The. nsf file uses the gamebyro custom syntax and uses its own syntax analyzer to compile it into the relevant platform code. In fact, the shader System of gamebyro is
The program and GPU program are encapsulated to shield the differences between different platforms, so that the application can use the same interface to interact with the GPU, however, the GPU program still uses CG or
The benefit of doing so is that when the platform changes, you only need to compile the corresponding shader program based on the specific platform, without modifying the application. Of course, shader
The system also directly supports files in CG and HLSL formats. The usage is similar to that of NSF and NSB files. Gamebyro's shader system provides a complete error checking mechanism for users.
Debug the program.
Gamebyro's shader system is integrated into all the supporting development tools, so that what you see is what you get. Art can directly see the effect of resources in the game in the tools, this improves the development efficiency.
Gamebyro introduces its own shader file format to provide convenience for cross-platform platforms, and also increases the complexity of the system. It is a little tedious to use and developers have to familiarize themselves with its syntax, if you want to develop special effects on your own without considering cross-platform development, you can directly use files in FX format without using nsf files.
Special materials provided by the engine
:
Additivelightmapsmaterial
(Adds the illumination map material and uses the additional Illumination Pattern to mix the illumination calculation results of the current scenario. The following illustration shows the rendering effect of the texture of the projected illumination graph .)
Alphatextureblender
(Texture Alpha mixing)
Aniso
(Light of the opposite sex, aircraft in the lower left ),Halo
(Halo effect. The plane above)
Asmskinninglighting
(Skeleton animation skin involved in illumination calculation)
Asmskinningnolighting
(The efficiency of the skeleton animation skin not involved in illumination calculation has been optimized)
Basebumpwithspatialglow
(Convex texture with glow effect)
Chrome
(The metal exterior uses basic textures, diffuse reflection cube map, mirror reflection cube map, normal textures, and other effects to achieve gloss and texture similar to the metal surface, and supports skin operations based on this effect)
Colorize
(Use a custom property to dynamically set or modify the color)
Fxskinning and hlslskinning
(Skin of a skeleton animation using a programmable rendering pipeline)
Generalglow
(Normal glow effect)
Generaldiffusespecularglow
(Normal reflection of high-gloss glow)
Generaldiffusespecular
(Normal mirror highlight, supports skin Operation)
Dot3bumpmap
(Concave-convex texture, the right image shows the skin effect)
Glass (glass effect)
Oilyfilm
(Oily film)
Luminancetransfer
(Similar to the heat source detector)
Outlining
(Blueprint or sketch)
Parallaxmapping
(Parallax texture. The right figure below shows the effect of parallaxmapping)
Perpixellighting
(Pixel-by-pixel illumination, supports both fixed pipelines and programmable rendering pipelines)
Skinnedtoonshadingwithoutline
(Cartoon rendering, supporting skeleton skin and stroke)
Texture
:
Gamebyro's texture system supports multiple textures, projection textures, dynamic textures, and special effects textures. It is platform-independent to use some advanced features of textures. Of course, the texture function in gamebyro is still limited by hardware features. For the main features and limitations, see the Renderer.
Tools and plug-ins:
G
Amebyro provides the Scenario Editor, resource browser, resource Physical Model Browser, animation editing tool, font creation tool, and 3 DMAX and Maya plug-ins. Material editing is performed in the plug-in, this tool contains a complete 3D resource development process.
Physical System
Gamebyro uses physx to provide physical simulation. With just a few lines of simple code, you can establish a connection between gamebyro and physx.
Explicitly call related interfaces to synchronize physical simulation objects and scenario objects, that is, the results of physical simulation apply to the objects in the scenario. At the same time, you can also determine whether to wait for the physical simulation operation through parameters.
. This ensures a certain degree of flexibility. For example, you can synchronize static objects to achieve optimization. You can also place the updated interface to be called at the beginning of the next loop.
Reduces thread congestion caused by simulation of waiting objects and makes full use of CPU resources.
Particle System
:
Gamebyro's particle system provides a complete plug-in system for particle generation tools such as 3DS MAX and Maya, and fully supports soft particles, that is, particles are affected by force.
Stream Processing Engine
:
Gamebyro implements a fully cross-platform stream processing engine. Users can easily use it to complete multi-threaded tasks, such as loading resources, to fully utilize the power of the multi-processor platform without paying attention to the underlying details.
Efficiency Analysis:
To fully evaluate gamebyro, I tried to perform a simple test on the rendering efficiency of gamebyro. My machine configuration is as follows:
L CPU: e2180
L GPU: 2400pro
L memory: 2 GB
It basically represents the current configuration of low-end players.
Scenario 1
:
It is a big outdoor terrain scenario, including buildings, water surfaces, and surfaces using normal maps. Apart from vegetation, it basically contains most of MMORPG's outdoor scene elements. The average number of frames in the last test is 21. The reason why the number of frames is low is that the whole scenario uses pixel-by-pixel illumination, while not using the level of detail (SLS) for optimization.
Scenario 2
:
In this scenario, 100 roles are playing different animations, with each role having 51 bones. In this scenario, there are 287900 polygon and 556600 vertices.
There is a point light source and a line light source. In the absence of shadow, the number of frames is about 27 ~ About 28 frames. These bone animations use the bone animation optimization method provided by gamebyro to improve performance.
The above results show that the animation rendering efficiency of gamebyro's skeleton is acceptable, while the performance of the outdoor terrain rendering system is slightly insufficient. If there is no role or vegetation, it can only be achieved.
About 22 frames. If the actual game environment is counted as the performance consumption of other game systems (Network, logic, UI, etc.), this is not enough for gamers to play smoothly, further manual optimization is required.
Summary
:
Gamebyro has a flexible architecture, which is easy to use and expand. gamebyro has a complete set of development tools and a complete art development process. gamebyro fully supports cross-platform and facilitates game transplantation; at the same time, in order to ensure flexibility, the design focuses more on functions and expansion, rather than performance.
Highly customizable brings about lower integration. gamebyro does not provide a game framework, and the map editor only implements the most common function, that is, placing the surface and objects. That's to say
If you want to use gamebyro to develop a product, you need to integrate gamebyro and modify and expand it. This is also the biggest difference between it and unrealengine3
.
Author: ye Qianyi