Monday, November 28, 2011

Intro - Tech Demo Fast Terrains


Welcome to the Edge 3D Engine development project. I decided to start this blog to introduce anyone who was interested in fast 3D rendering concepts to current and new developments in the field. The idea is to build up a set of features that can be used to demonstrate and develop an application or game using the best methods and concepts employed in modern game and rendering engines. The engine is being developed as a C++ DLL, C++ Library and Dot Net DLL which can be imported and used easily. I decided to go down the dot net route also to open the technology up to a greater audience. A demo download will be available once the current phase of testing is complete.

As I enjoy the principles of 3D technology and real time optimised processing I became quite  interested in 3D game technology. I've used and reviewed a lot of 3D game engines and started experimenting in the technology about 3 years ago. About a year ago it became obvious that for indie (Independent) developers, access to fast and powerful engines was an impossibility. For this reason I decided to develop a fast rendering engine and use it as a framework to introduce current and new technology that anyone can use.


2x2km high detailed terrain rendering at approx 1350 fps (nvidia 450GTS - mid range card)


The video above is a basic introduction to the capabilities achieved so far. The initial scene shows a 2x2km landscape without trees, foliage, rocks or shadows, but with high definition ground textures and the blending of sand and grass based on an underlying map. Significant optimisations have been made in the terrain engine as pretty much all modern engines use a chunk system by which the camera is surrounded by 4 to 9 high LOD (Level Of Detail) terrain patches or chunks. Typically each chunk has a resolution of 256x256 and as most modern games use a 2m resolution (Skyrim & Crysis for eg), this represents an area of 225m to 750m of high res terrain around the camera. As the camera moves. LOD chunks behind are replaced with one's of less resolution, and lower resolution chunks in front are replaced with higher ones. This is a tried and tested method and is the subject of ongoing academic and white paper research topics in the pursuit of faster, more detailed systems. This high definition over a large area is not really required and is a legacy of brute force methods developed as GPU efficiency has increased. As each chunk is fixed to a 256x2m resolution, the closely spaced triangles that make up the terrain model are effectively lost to the eye, the further they are from the camera they are.

Looking at the video time index:

0:32 The high resolution ground textures can be seen (later a cliff rock texture will be included for the steeper slopes). 

0:58 The transition in LOD on the hill in front is shown in the wire-frame mode (which defines the polygons of the model), and later the solid textured mode to show the seamless transition. 

1:31 You can see the very smooth transition from the dynamically lit low LOD to the high LOD terrain patch, particularly on the sandy section to the left and middle. A striking terrain undulation is used here (often avoided in modern technology) to show the effect clearly. There is a plan to artificially embed the high LOD shading (of the subtle undulation) in the low LOD terrain model, making this transition almost undetectable and increasing far off detail without any real impact on performance.

This approach uses a new method of a patch traveling with the camera, building detail in steps of 4m instead of 256m. This effective means only one high LOD patch is drawn at any one time, reducing the load on the GPU (Graphic Processing Unit). The scene is rendered in a window (generally slower than full screen mode) @ 1024x768, GPU is GTS450 with no anti aliasing or isotropic filtering. This is particularly significant as the base FPS (frames per second) on modern engines, drawing such a terrain is approx 500 fps on a mid range GPU, the baseline for Edge is 1350 fps, which means more detail can be added before the 30-60fps minimum is hit. (more fps means more details can be added before the engine can't provide an adequate fps performance).

There are alternative methods to implement this, but all the ones I've examined so far are slow as they rely on a bottle neck in current GPU technology. The Edge engine circumvents this.

I will be introducing the various concepts and technologies required for a effective game / scene renderer in this blog, and below is a current status snapshot.

Features that have already been researched an implemented are: 
  • Fast and detailed terrain rendering (with dynamic lighting).
  • Huge terrain support with very far draw distance (demo shows 2km).
  • Fast terrain height determination formula.
  • Dynamic sky with drifting clouds.
  • Very fast GPU based tree and foliage renderer (models can be loaded from HDD).
  • Static Mesh Loading with optional custom shaders.
  • Mesh instancing (reuse one mesh from memory with differing parameters).
  • LOD control for Level of Detail switching.
  • Load custom shaders for 2D & 3D GPU programmed effects.
  • HUD text and sprite elements.
  • Debug output file.
  • Texture loading.
  • Accurate render timer.
  • Direct access to 3D Device for custom coding in C++.
Features that have been researched, tested and are ready for implementation are:
  • Fast GPU shadows.
  • Animation for characters.
Features that have been researched, tested and require some further development are:
  • Water (similar to Crysis, Two Worlds 2 and Skyrim standards).
  • 2D post process filters, such as bloom and depth of field. 
 Features that will be researched an implemented are:
  • Physics (probably nVidia due to the GPU hardware acceleration model).
  • Network support (probably Raknet, the proven industry standard).
  • Pak files to compress and encrypt game assets.
  • Path nodes and path finding functions.
  • Scene editor.
  • Scripting (if in demand and probably Lua script)

This comprehensive list represents all of the components required to make an effective scene renderer or game. I hope you found this interesting and enjoy the details to come, it should get more interesting as the demo scene develops :)

No comments:

Post a Comment