An open API service indexing awesome lists of open source software.

https://github.com/hilbertcube/3dgl-render-engine

A lightweight 3D rendering engine built with OpenGL, featuring a collection of convenient wrapper classes to simplify development.
https://github.com/hilbertcube/3dgl-render-engine

c cmake cpp glad glew glfw3 glm glut low-level opengl

Last synced: about 2 months ago
JSON representation

A lightweight 3D rendering engine built with OpenGL, featuring a collection of convenient wrapper classes to simplify development.

Awesome Lists containing this project

README

          

# 3D Render Engine

![C](https://img.shields.io/badge/c-%2300599C.svg?style=for-the-badge&logo=c&logoColor=white)
![C++](https://img.shields.io/badge/c++-%2300599C.svg?style=for-the-badge&logo=c%2B%2B&logoColor=white)
![OpenGL](https://img.shields.io/badge/OpenGL-%23FFFFFF.svg?style=for-the-badge&logo=opengl)
![CMake](https://img.shields.io/badge/CMake-%23008FBA.svg?style=for-the-badge&logo=cmake&logoColor=white)
![Windows](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge&logo=windows&logoColor=white)
![Linux](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black)
![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)

[comment]: <> (Source: https://ileriayo.github.io/markdown-badges/)

## Overview

3D Object Renderer for common geometric shapes, including triangles, cubes, spheres, and torus (donut) with texture support. Built with OpenGL, a cross-platform, low-level API for rendering 2D and 3D vector graphics alongside CMake, GLFW, GLAD, glm, and fmt.

Minimum Requirements:
1. C++17
2. C17
3. [CMake](https://cmake.org/) 3.10

### Preview:
![Earth and Moon](media/render_engine.png "Earth and Moon")
![Cube](media/cube.png "Cube demo")

## Installations

* [GLFW](https://www.glfw.org/download). There are two options: build from source using CMake or use prebuilt binaries.
* [GLAD](https://glad.dav1d.de/). Select API > gl > Latest Version. The API version doesn't matter, as long as it is greater than the GLFW version you're using. After that, go to Profile > Core, then press "Generate" and download the zip folder.
* [GLM](https://github.com/g-truc/glm/tags). This is a header-only library, so linking is very straightforward.
* [FMT](https://github.com/fmtlib/fmt). The easiest, and best way is to install with vcpkg and then link it with CMake.

## Build

Create a `build` directory

```bash
mkdir build
cd build
```
### Windows (MSVC)
**Configure**, **build**, and **run** the project with **release** (recommended)

```bash
cmake --build .\build\ --config Release
.\build\Release\{file-name}
```

or with **debug**:

```bash
cmake --build .\build\ --config Debug
.\build\Debug\{file-name}
```

### Linux / macOS

On Linux and macOS, CMake does not use the --config flag in the same way. Instead, you specify the build type when configuring:

```bash
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
./build/{file-name}
```

Or for Debug mode:

```bash
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build
./build/{file-name}
```

## Usage

### Controls

| Key / Input | Action |
|-------------|------------------|
| **W** | Move forward |
| **A** | Move left |
| **S** | Move backward |
| **D** | Move right |
| **Mouse** | Look around |
| **Esc** | Close the window |

## Read more: some libraries for OpenGL applications

*Reference: https://github.com/eug/awesome-opengl*

* [assimp](https://github.com/assimp/assimp) - Portable library to import 3D models in a uniform manner.
* [Bullet](http://bulletphysics.org/wordpress) - It provides state of the art collision detection, soft body and rigid body dynamics.
* [fltk](https://www.fltk.org/) - C++ Toolkit to generate UI widgets portably. [LGPLv2](https://www.fltk.org/COPYING.php)
* [freeGLUT](http://freeglut.sourceforge.net) - Mature library that allows to create/manage windows containing OpenGL contexts.
* [GLFW](http://www.glfw.org) - Modern library for creating/interact windows with OpenGL contexts.
* [GLFM](https://github.com/brackeen/glfm) - Supplies an OpenGL ES context and input events for mobile devices and the web.
* [glm](http://glm.g-truc.net/0.9.6/index.html) - Mathematics library for graphics software based on the GLSL specifications.
* [Magnum](https://github.com/mosra/magnum) - It is a 2D/3D graphics engine for modern OpenGL.
* [MathFu](http://google.github.io/mathfu/) - C++ math library developed primarily for games focused on simplicity and efficiency.
* [Newton](http://newtondynamics.com/forum/newton.php) - It is a cross-platform life-like physics.
* [OGLplus](http://oglplus.org) - Collection of libraries which implement an object-oriented facade over OpenGL.
* [SDL](http://www.libsdl.org) - Designed to provide low level access to multimedia and graphics hardware.
* [SFML](http://www.sfml-dev.org) - Simple interface to ease the development of games and multimedia applications.
* [SOIL](http://www.lonesock.net/soil.html) - Tiny C library used primarily for uploading textures into OpenGL. (see [SOIL2](https://bitbucket.org/SpartanJ/soil2))
* [Pangolin](https://github.com/stevenlovegrove/Pangolin) - Lightweight portable rapid development library for managing OpenGL display / interaction and abstracting video input.
* [morphologica](https://github.com/ABRG-Models/morphologica) - OpenGL graphics engine for data visualization, especially of numerical simulations.
* [raylib](https://github.com/raysan5/raylib) - A simple and easy-to-use library to enjoy videogames programming.