GithubHelp home page GithubHelp logo

zang3th / salinitygl Goto Github PK

View Code? Open in Web Editor NEW
15.0 3.0 3.0 393.52 MB

OpenGL baselayer library in C++

License: MIT License

C++ 95.50% CMake 0.87% GLSL 3.28% Shell 0.36%
opengl cpp rendering-engine rendering graphics-engine engine 3d-graphics-engine 3d-graphics-renderer engine-development glfw

salinitygl's Introduction

SalinityGL

Build Static Analysis OS Release

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_far GreenWorld_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_color1 Liquefied_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

Version Date Commit
[Count / ID]
Lines of code
[Apps / Engine]
Notes
0.2.0 28.07.2024 [373 / 7bbc453] [1690 / 8990] Completion of the Liquefied demo app
0.1.1 14.01.2023 [255 / d425a33] [480 / 4250] Completion of the GreenWorld demo app
0.1.0 11.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

I always work on and off on this project, but I try to make more regular releases until the end of 2024.

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!

Library Version Commit Updated in Engine Functionality
GLFW 3.4.0 7b6aead 13.04.2024 Window and input management
glad 2.0.6 658f48e 13.04.2024 OpenGL function loading
imgui 1.90.4 277ae93 13.04.2024 GUI
GLM 1.0.1 0af55cc 13.04.2024 Mathematics
miniaudio 0.11.18 3898fff 20.09.2023 Audio
stb_image 2.28 3ecc60f 20.09.2023 Image loading
tinyobjloader / 853f059 20.09.2023 Wavefront obj loading
Easylogging++ 9.96.7 5181b40 19.07.2021 Logging

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.

salinitygl's People

Contributors

zang3th avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.