Skip to content

balintkissdev/3d-renderer-rust

Repository files navigation

Real-time 3D renderer with OpenGL 4 written in Rust

Build

A hardware-accelerated 3D renderer written in Rust. Runs using OpenGL 4.3 as graphics API on desktop.

Click here for C++ version of this project

Demo

Table of Contents

Try it out!

Motivation

This project is a demonstration of my ability to write cross-platform 3D graphical applications in Rust. I designed my application to balance the correct level of abstractions and performance optimizations. The project showcases confident usage of the following technologies:

  • Rust
  • OpenGL 4.x
  • Immediate mode overlay GUI using Dear ImGui (as opposed to retained mode GUI frameworks like Qt)

Future additions will include Direct3D, Vulkan rendering backends and additional post-processing effects.

Features

  • 3D model display from OBJ file format
  • Fly-by FPS camera movement
  • Skybox display using cube-map
  • Directional light with ADS (Ambient, Diffuse, Specular) lighting (Phong shading)

Requirements

Desktop executable requires an OpenGL 4.3 compatible graphics adapter to run. Check if your hardware supports OpenGL 4.3 and have the latest graphics driver installed.

Required build dependencies on Debian, Ubuntu, Linux Mint:

sudo apt-get install extra-cmake-modules libglfw3-dev wayland-protocols libxkbcommon-dev xorg-dev

Required build dependencies on Fedora, Red Hat:

sudo dnf install extra-cmake-modules glfw-devel wayland-protocols wayland-devel libxkbcommon-devel libXcursor-devel libXi-devel libXinerama-devel libXrandr-devel

No additinal dependencies are required to be installed on Windows builds.

All other dependencies are either included in vendor folder or automatically downloaded by cargo.

Build

  1. Make sure you have the latest stable version of Rust installed, following the instructions on https://www.rust-lang.org/tools/install

  2. Clone the repository

git clone https://github.com/balintkissdev/3d-renderer-rust.git
cd 3d-renderer-rust
  1. Compile and execute the release build
cargo run --release

Usage

Use keyboard and mouse to navigate the 3D environment.

  • Movement: W, A, S, D
  • Mouse look: Right-click and drag
  • Ascend: Spacebar
  • Descend: C

Modify UI controls to change properties of the 3D model display.

Resources