Lightsteam Engine

A 3D video game engine written in C++ and powered by Open GL with a custom render pipeline.

Lightsteam engine is an university project made in less than 4 months during the 3rd year class on Engine Development at UPC CITM bachelor's degree in Video game Design and Development.

Read the README for more information about the last version of the engine.

About me

I am Robert Recordà i Illas the author and solo developer of Lightsteam Engine.
I started programing back in 2019 with Java when I was doing a vocational training in cross-platform application. When I finished the two years of the course, the only ideas I had in mind were always related to video games. That's when I decided to study a video game degree in a university that bouth enhance my ideas and my programming skills.

This project is a milestone in my career and the final result of a personal challenge that I gave to myself.

LinkedIn

Core sub-systems

Console


A console that registers and prints every action taken by the user inside the editor, from a texture import error/success or even a simple brightness change.

Shader text editor


A GLSL editor powered by ImGuiColorTextEdit that allows Vertex and Fragment shader programing on the same file, improving reliabilty inside the engine and easing the coding.

Game Objects


Lightsteam uses a simple Game Object system based in other engines like Unity, this makes the workflow intutive and fast to learn to any novice developer.

Components


Components give functionalities to the Game Object, like becoming a camera (Camera Component) or having a 3D model (Mesh Component).
Game objects without a Transform component can exist in the scene.

Resource Manager


Ensures that all resources being used by a scene are only loaded once even if used multiple times. It also ensures a correct unloading of the resources freeing all used memory.

Materials and Shaders


Inside the assets window materials and shaders can be created. By applying materials to a game object, shaders can be assigned to those making every uniform variable can be modified from the inspector without the need of recompiling the shader.

Multiple Game Cameras


The engine support multiple cameras to render in the same scene. Inside the configuration menu there is an option to change the active camera.

Assets Window


All assets used by the engine are stored and displayed inside an intuitive and responsive Assets Window.

Shader Piepeline in detail

Lightseam engine uses a custom Render pipeline that dynamically allows the use of GLSL written shaders by just attaching shaders to materials.

Shader and Material Creation
Right click inside the assets manager for a pop-up menu with the options to Create a new Shader or Material.
Once one of the options is selected, just input the desired name and select create.

Shader editor
Double click any ".shader" file inside the manager to open a shader editor window.
The editor allows Vertex and Fragment shader programing on the same file, improving reliabilty inside the engine and easing the coding.

Default Shader
When importing a model to the library the default shader will be automatically applied to its material(if there is one in the model's fbx).
You can see the default shader inside the engine's GLSL editor HERE.

Template Shader
The very same default shader is also applied to every new GLSL shader file created inside the assets manager. This shader contains the most basic configuration and serves as a template for every new shader.

Material
Allows the use of shaders by a game object by linking a shader to a mesh.
Every material is unique meaning that two game objects with the same material will have the same uniform configuration, updating the values from one will transfer to the others, while having different materials with the same shader but with different values will result in different configurations of the same shader.

Uniforms
When a shader is applied to a material, almost all uniforms (except KEY uniforms) are shown in the inspector where they can be modified dynamically with real-time feedback. The save button must be pressed once the desired values are set.
GLSL(401) has a total of 105 different uniforms due to the current engine capabilities not all uniforms are currently supported, only the most essential ones can be used and updated from the inspector.
This is the list of supported uniforms:

  • bool
  • int/uint
  • float
  • float vec2 (vec2)
  • float vec3 (vec3)
  • float vec4 (vec4)
  • double
  • sampler2D
  • float mat4 (mat4)



Special Uniforms
This are uniforms that are used natively by the engine and that every shader must use if presice functionality wants to be achieved.

  • Projection
    uniform mat4 Projection;
    Every shader must have it inside the Vertex macro. Allows the use of the projection matrix.

  • View
    uniform mat4 View;
    Every shader must have it inside the Vertex macro. Allows the use of the camera view matrix.

  • Model
    uniform mat4 View;
    Every shader must have it inside the Vertex macro. Allows the use of the model matrix.

  • Time
    uniform float LssTime;
    Every shader must have it inside the Vertex macro. Allows the use of the engine internal time. Necessary for shader that update over time like a water wave.

  • Colour special Keyword
    uniform vec3 thisIsAColor;
    uniform vec4 thisIsAcolour;
    When using a vec3/vec4 for colour picking, the keywords (Color,Colour,color or colour) inside a name updates the inspector view of the uniform variable to be a colour picker instead of a simple vector input.

Binaries
Every time a shader is saved in compiled, the compiled binary is saved directly into the library. Every time that an already compiled shader is loaded by the resource system, it checks if the current binary version is the last (if it is not, it recompiles) and loads the binary directly from the library.


Licence

MIT License
Copyright (c) 2022 Robert Recordà i Illas


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.