View on GitHub

Ymir Engine

A 3D game engine developed from scratch in C++ using SDL and OpenGL

Ymir Engine: Project Description

Ymir Engine is part of the Game Engines subject, on the third year of the Videogame Design and Development degree, taught at CITM UPC (Terrassa) and supervised by Miquel Suau.

The engine has been made from scratch in C++ using SDL and OpenGL to manage graphics. The main target of the project is to be able to integrate complex systems such as graphics management and game engine architecture in a simple and understandable way for educational purposes.

YmirEngineLogo

Team Members: About Us

Francesc Teruel Rodríguez

Francesc

Game Developer in C++ and C# with high focus on low level systems and engine-related programming.

Joel Romero Botella

Joel

Game Designer specialized in the field of characters and levels, with a medium level of knowledge in 3D Modeling.

Ymir Engine: Main Core Sub-Systems

The engine is made from several core sub-systems that work together to provide the necessary features to the user, in order to serve as an environment to create games:

Geometry Viewer

Editor

Editor

Graphics Pipeline (with Shaders)

Drag & Drop

GameObject Structure & Components

Hierarchy & Inspector

Hierarchy

Inspector

Console

Console

Engine Editor

Camera Frustum

Frustum

Scene & Game Framebuffers

Framebuffers

Custom File Format

CFF1

CFF2

Serialization

Resource Management

Resource1

Resource2

Resource3

Time Management

Time1 Time2 Time3

High-Level System: Shader Pipeline

The last assignment sub-system chosen for Ymir Engine was the Shader Pipeline, which is the sequence of stages that a graphics processing unit (GPU) goes through to render graphics in computer graphics applications. Shaders are small programs written in languages like OpenGL Shading Language (GLSL) that run on the GPU and are used to control various aspects of the rendering process.

Shader Pipeline for rendering geometry (VAO)

The rendering pipeline of the engine uses shaders alongside a Vertex Array Object (VAO) in order to draw geometry into screen. Here are some screenshots from the code itself that show the insides of the mesh drawing of the engine:

VAO

Rendering

Shader Editor

The Shader Editor is an ImGui Window with a Text Editor that is capable of reading GLSL language attached to it. It has an input text field that displays the name of the current shader (modifiable) and several buttons:

If you want to open an existing shader on your project, you can do it by going to the Assets Window and then opening the Shaders/ folder, and then click on the shader to open it on the Shader Editor.

Shader Editor

Shader Hot Reload

Hot Reload

Compilation Messages and Errors

When the process of compilation of a shader is executed, the engine will display some messages on the console, depending on the result of the compilation.

Correct

Error

Dynamic Uniform Detection

When you load a Shader on the engine, it has an algorythm to detect editable uniforms that you may have created on the shader’s code. Once detected, the engine displays them for you on the inspector and binds them with the shader code, so that you can modify the value from the inspector directly without having to hardcode them.

Dynamic Uniform Detection

Shader Library

The engine keeps track of the loaded shaders and lets you change between them on the Component Material of the GameObjects.

Shader Library

Water Shader

There is a flat mesh (plane) on the scene that simulates simple water. The shader is made from:

Water Shader

…and more shaders!

Lava Shader

Lava Shader

Rainbow Shader

Rainbow Shader

Color Shader

Color Shader

Workflow Video

Repository and Releases

License

MIT License

Copyright (c) 2023 Francesc Teruel Rodríguez

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.