Skip to content
This repository was archived by the owner on Dec 4, 2025. It is now read-only.

Repository files navigation

SalinityGL

BuildStatic AnalysisOSRelease

Introduction

SalinityGL is an OpenGL baselayer library for creating (2D/3D) visualization applications. The goal is to create a library that is easy to use and lightweight. SalinityGL provides a thin OpenGL abstraction layer and some basic helper functions to support the process of building rendering applications.

SalinityGL is written in C++17 with OpenGL 4.5. Currently, only Linux is supported. To get started, take a look at the building and compiling section.

During development, several demo applications were created to test the engine's capabilities. These apps are built and compiled separately from the engine core, but a global parameter file is maintained for the configuration of some app-to-engine settings.

The development of this library also serves my educational purposes.

SalinityGL is licensed under the MIT LICENSE.

Project structure

SalinityGL/
├── Apps/ # Demo applications
│ ├── GreenWorld/ # 3D nature scene
│ └── CellSim/ # 3D Cellular Automata System (on hold) ⌛
│ └── Liquefied/ # 2D Eulerian Fluid Simulation
├── Engine/
│ ├── Application/ # Application and interface stuff
│ ├── Core/ # Utilities and core engine functionalities
│ ├── Debug/ # Logging and error handling
│ ├── Physics/ # Code for cellular automata and fluid simulation
│ ├── Rendering/ # GL stuff, buffers, renderer ...
│ └── Engine.hpp # Main header for include in the applications
├── Res/ # Assets, sounds and screenshots
├── Scripts/ # Scripts for static analysis, profiling and building
└── Vendor/ # Third party libraries

Base layer functionalities

  • Thin OpenGL-Wrapping
    • VAO, VBO, IBO, FBO
    • Resource loading and management (shaders, textures)
    • Error handling
  • Window creation
    • UI
  • Camera + input management
  • Rendering
    • 2D-Sprite-Rendering
    • 3D-Model-Rendering
      • Loading of OBJ-Models
      • Dynamic mesh creation (planes, terrains)
      • Cubemaps/Skyboxes
    • Pixel-Rendering
    • Lighting
      • Blinn-Phong
      • Shadow rendering
      • Normal mapping
    • Water rendering
    • Instanced rendering
      • 2D particle system
        • Smoke
      • Grid-Rendering
    • Dynamic texture subsampling
  • Physics
    • Cellular Automata System (very primitive)
    • Eulerian Fluid Simulation
  • File management
  • Profiling
  • Audio

Demo applications

GreenWorld

Nature scene with water rendering, normal mapped objects, and a particle system to display smoke.

GreenWorld_farGreenWorld_close

CellSim (on hold) ⌛

3D Cellular Automata System (experimental - very primitive). Serves as a test and benchmark application for now.

CellSim

Liquefied

2D Eulerian Fluid Simulation on the CPU.

Liquefied_color1Liquefied_color2

Building and compiling

The engine and the demo applications are compiled separately. The engine is compiled into a static library and then included in the demo applications' binary. All external libraries (Vendor/) are getting directly included (via source) into the engine and need no separate install. The only exception is GLFW, which gets linked dynamically (.so file is provided).

What you need

  • Linux
    • Tested with Ubuntu 16.04 - 24.04
  • C++17 compiler
    • Tested Clang and GCC
  • CMake 3.20 or newer
  • OpenGL 4.5 compatible graphics card and driver

How to get started

  • Install the external dependencies (if needed)

    apt-get install cmake pkg-config
    apt-get install libglu1-mesa-dev mesa-common-dev
    
  • Clone/download the repository or a particular release

    git clone https://github.com/Zang3th/SalinityGL
    
  • Debug configuration

    mkdir Build_Debug
    cd Build_Debug
    cmake .. -D CMAKE_BUILD_TYPE=Debug -D CMAKE_CXX_FLAGS="-g"
    make -j
    
  • Release configuration

    mkdir Build_Release
    cd Build_Release
    cmake .. -D CMAKE_BUILD_TYPE=Release -D CMAKE_CXX_FLAGS="-O3 -Wno-unused-but-set-variable -Wno-unused-result"
    make -j
    
  • Run the demo applications

Releases

VersionDateCommit
[Count / ID]
Lines of code
[Apps / Engine]
Notes
0.2.028.07.2024[373 / 7bbc453][1690 / 8990]Completion of the Liquefied demo app
0.1.114.01.2023[255 / d425a33][480 / 4250]Completion of the GreenWorld demo app
0.1.011.06.2022[229 / 218a55e][575 / 4110]First official release
  • 07/2021 - 09/2021: Rewrite of the engine core
  • 01/2020 - 09/2020: Some very early projects (still under Windows)

Roadmap

The future of this project is uncertain. For now it is on hold while I focus on other things like learning Vulkan.

Release preview

  • v0.2.1: Multithreading and Compute Shader implementation of the Liquefied app

Backlog

  • 3D fluid simulation
  • Some kind of raytracing project

External libraries

Thanks to all the creators and contributors of these projects!

LibraryVersionCommitUpdated in EngineFunctionality
GLFW3.4.07b6aead13.04.2024Window and input management
glad2.0.6658f48e13.04.2024OpenGL function loading
imgui1.90.4277ae9313.04.2024GUI
GLM1.0.10af55cc13.04.2024Mathematics
miniaudio0.11.183898fff20.09.2023Audio
stb_image2.283ecc60f20.09.2023Image loading
tinyobjloader/853f05920.09.2023Wavefront obj loading
Easylogging++9.96.75181b4019.07.2021Logging

Credits

This project uses PVS-Studio, a static analyzer for C, C++, C#, and Java code that's free to use for open source projects and students.