Debut

Debut is a graphics engine born from a series of tutorials, which ended after a while: having followed all the videos, I couldn't help but try to continue on my own, both to keep learning new things and test the skills I previously acquired.

3D rendering

3D models must be imported using the Asset Manager. After that, they're compressed and stored in binary format: when importing a 3D model, the proper entities and components are added. Data is sent to the GPU just once, when the model is instantiated. A default shader is used to render the models, but users can easily swap it for a custom one using the editor.

Asset Manager

Debut includes a simple asset manager, used to handle resources references inside a project. Instead of storing a whole asset in memory, a component just needs to store its Universal Unique Identifier and request the actual asset to the asset manager when needed. UUIDs are decoupled from physical paths via a simple hashmap, that must be saved on disk along with the project. Possible improvements include streamable assets, running the asset manager in its own thread and deallocating the resources when they're not needed, perhaps using an LRU policy.

Materials

Users can create their own materials using Debut. They just need to write a GLSL shader and assign it to a newly created material. The engine will extract the shader metadata and expose its uniforms to the user, both via an API and via the editor, making it possible to edit parameters at runtime or in edit mode.

Shadows

Debut supports shadows generated by directional lights using Cascaded Shadow Maps. The higher the distance of a fragment from the camera, the lower the resolution of its shadow will be: in this way it is possible to support both distant and near shadows without the need for a huge shadow map.

Post processing

Post processing is made of two components: Stack and Layers. The Stack is an asset that represents a post processing configuration: it is made of Layers, each of which applies an effect to the framebuffer. A Stack asset can be assigned to a CameraComponent, applying all the effects to its output. There are two kind of effects: user effects can apply any user-made shader to the frame buffer and are executed in a single pass. Core effects are implemented by me and need many passes and ad-hoc solutions: an example of Core effect is Blur. For high values, instead of having a huge kernel, the image is rendered on a framebuffer that is half the size of the final one. If needed, the process is repeated with a buffer that is half as big as the previous one and so on, exploiting automatic bilinear interpolation.