So, what is a 3D engine?

Basically a 3D engine is a software that is meant to display 3D images on a screen. To do so, a modern 3D engine uses an API (Application Programming Interface) that will communicate, through a driver and often a runtime, to the hardware. A 3D engine might be part of a game engine, although game engines don't necessarily include one.

The API they use is at a lower level, and deals with Vertex Buffers, Index Buffers, Shaders, Textures, RenderTargets and so on, while the 3D engine is higher up in the stack and has Meshes, Bones, Effects, Textures and so forth. A 3D engine offers a simple interface so that the user of the engine does little more than choose what object to render with which materials, and how. That wet rock with bump mapping and reflections, for example.

A Game Engine is the highest level view, it provides basically all services a game might require to run, such as a 3D engine (to render a 3D world on screen), a sound module (to generate an immersive sound environment), a network module (to allow network gaming), an input module (to handle the keyboard/mouse/joystick/gamepad), a physics module (to make the objects of the world react like real objects), an AI module (to make the NPC look smart, or not too dumb), and maybe a disk I/O module (to handle file loading/streaming).

A 3D engine's task is only to render the world to the screen, and it might interact with the disk I/O module differently given its architecture. Some games load everything in memory at the start of a level, others stream the content as the game progresses, for example.

Not all 3D engines provide the same services, and some are rather simple, in that they just offer a way to render things on screen, but leave the responsibility of being fast to the user, who has to handle both the RAM (Random Access Memory) and CPU (Central Processing Unit) cost associated to their use.

That's not the kind of 3D engines I am interested in. To me, a 3D engine (or any other piece of software) is supposed to provide the best experience to its user, in the simplest way. I find that, in computer science, everything should be Simple, Fast, Efficient, and Elegant, as well as following the K.I.S.S. (Keep It Simple, Stupid) principle.

What I'll write about in this article series, is the technology behind a 3D engine which only takes a few user parameters, such as amount of RAM it might use, and makes sure that all the usual operations are fast, so that the user doesn't have the overhead of tweaking it for performance or memory cost.