Skip to content

mikemorandi/3d-rendering-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

3D Playground

3D Playground consists of a library component 3DEngine which holds components to build a graphical 3D application and an executable Graphics Playground which creates a window, loads a scene and connects mouse and keyboard inputs. As the name suggests, this is a playground to experiment with 3D rendering concepts.

The engine uses modern OpenGL 4.1 with GLSL shaders to leverage features of modern graphics cards in order to achieve high realism while maintaining interactive frame rates.

Cross-Platform Support: Builds on Windows, macOS, and Linux using CMake

Features

  • Loading of complex scenes and different model / image formats
  • Very basic animation capabilities
  • Multiple camera models
  • Bounding volume hierarchy
  • Mouse & keyboard interactivity
  • Platform independent
  • Supports Wavefront Obj files
  • Leverages C++ 17

Rendering features

  • Illumination from various light types (directional, spot, point, SH)
  • Shadow mapping with PCF
  • Multi-texturing
  • Environment mapping
  • Spherical Harmonics lighting

Impressions

Car9

Dragon

heli

Prerequisites

  • CMake 3.20 or higher
  • C++17 compatible compiler (Visual Studio 2019+, GCC 9+, Clang 10+)
  • vcpkg for dependency management

This project now uses CMake for cross-platform builds and works on:

  • Windows (Visual Studio 2019+, MSVC)
  • macOS (Clang, Xcode)
  • Linux (GCC, Clang)

Dependencies

This project uses vcpkg to manage dependencies.

Required libraries:

Install dependencies:

macOS:

vcpkg install glfw3:x64-osx glbinding:x64-osx glm:x64-osx tinyxml2:x64-osx

Linux:

vcpkg install glfw3:x64-linux glbinding:x64-linux glm:x64-linux tinyxml2:x64-linux

Windows:

vcpkg install glfw3:x64-windows glbinding:x64-windows glm:x64-windows tinyxml2:x64-windows

Building

See BUILD.md for detailed build instructions for each platform.

Quick start (all platforms):

mkdir build && cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake
cmake --build . --config Release

Note: Set the VCPKG_ROOT environment variable to your vcpkg installation path (e.g., export VCPKG_ROOT=/path/to/vcpkg on macOS/Linux or set VCPKG_ROOT=C:\vcpkg on Windows).

Running the Application

From the project root directory:

macOS/Linux:

./build/bin/"Graphics Playground" [scene.xml]

Windows:

build\bin\Release\"Graphics Playground.exe" [scene.xml]

If no scene is specified, the application will list available scenes interactively.

Platform Notes

  • BUILD.md - Build instructions for each platform

macOS

  • OpenGL 4.1 is supported but deprecated since macOS 10.14 (Mojave)
  • You will see deprecation warnings - this is expected
  • For long-term macOS support, consider migrating to Metal or SDL3 (see CROSS_PLATFORM_STRATEGY.md)
  • Tested on Intel Macs; Apple Silicon may have limited OpenGL support

Linux

  • Requires OpenGL drivers and X11/Wayland
  • Install mesa development libraries: sudo apt-get install libgl1-mesa-dev

Windows

  • Fully supported with Visual Studio 2019+
  • Legacy .vcxproj files still available for direct VS builds

License

This project is licensed under the GNU Lesser General Public License version 3. See LICENSE file in the project root

Known Issues

  • Rendering artifacts on Intel HD Graphics 4600
  • macOS OpenGL deprecation warnings (expected behavior)

About

3D rendering engine, based on OpenGL 4.1

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published