Rendering engine Cube 2s
rendering engine is designed around modern graphics processing units, which perform best with huge batches of geometry already stored in
video memory. Lighting is precomputed into
lightmaps—image files that correspond to geometry as textures—for efficient batching, with an additional stored directional component, that allows for efficient
shader-based lighting effects. The original
Cube engine's rendering engine assumed that overdraw (where polygons that do not appear in the final scene are occluded via the
z-buffer) was more processor-intensive than sending new streams of triangles to the graphics processing every frame, which vastly limited its performance on more modern hardware where
memory bandwidth is a greater limiting factor. The most recent releases (starting with "CTF Edition") support a precomputed visibility system (PVS) for graphics cards that do not support hardware occlusion.
Real-time editing Cube 2: Sauerbraten uses a 6-directional heightfield (or
octree) world model. An octree, in Sauerbraten, is a cube that can be split into eight smaller cubes; those smaller cubes are also octrees, and can be subdivided further. This allows much more complex level geometry and easier editing. Each cube-shaped node in the
octree represents a renderable volume, or a type of Marching cube, which are referred to as a
cube, where each edge of this cube can be lengthened or shortened to deform the cube into a variety of other shapes. Corners of cubes can also be "pushed" or "pulled" to create crude curves. The
what you see is what you get realtime editing has enabled level designers to add a lot of detail to maps, while reducing the time spent on actual creation. This is in contrast to traditional modern
polygon soup 3D engines which take a model generated as an essentially random batch of triangles from an external modelling program and attempt to
spatially subdivide the model's triangles after the fact by splitting them to fit into tree structures, such as a
BSP tree or even an
octree, that require costly pre-processing to build.
Cube 2s novelty thus lies in that the world representation is the
octree, or
Marching cubes, structure itself, from which efficient triangle batches are generated for the
graphics processing unit to render, without need for expensive and time-consuming pre-processing. ==Reception==