Rendering System - Lux-Vacuos/Voxel GitHub Wiki
In this page will be explained the rendering systems used in Voxel.
GUI
For the GUI Voxel uses NanoVG, an antialiased 2D vector drawing library. The low level code is stored in the NRendering class, this class has all the functions to draw stuff, from buttons to images. This methods are called by the high level UI system that handles all the positioning, user input, etc.
On the top a Window Manager/Display Server(kind of) handles all the UI using "Windows" like a real OS, each window is composed of components (Buttons, Images, Text, etc). The entire rendering is tied to this, if this breaks nothing can be viewed or interacted, even the game view, because it is a full-screen-borderless window.
Deferred Renderer
This renderer only supports 3D elements to be renderer and uses a MultiPass Deferred Shading technique, this is called Deferred Pipeline which stores all the information about the render. It is composed of Image Passes which are shader code that modifies the image, after each image pass the result is stored inside a FBO and finally renders the final image to a NanoVG Image that is used in the game window.
The Rendering Pipeline FBO uses 6 textures in a MTR (Multi Render Target) configuration: Diffuse, Position, Normals, PBR, Mask and Depth. Then with all the information the scene can be reconstructed in 2D space, the performance is higher because only the visible pixels are shaded but has some disadvantages because only the visible information is available.
3D Renderers
All the elements that can be rendered uses a rendering system based on the type of object. Chunks uses the Tessellator, a high-level renderer that allows to create 3D models on the fly. Entities uses the EntityRenderer a fast shared-data renderer. Particles uses the ParticleRenderer, a instanced rendered that runs in forward shading. The 3D mesh renderers supports Diffuse textures, Normal Mapping and PBR, none of the renderers that run in deferred shading supports alpha blending.