3D CPU Render Engine from scratch for learning purpose
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
CMake
extra
include
resources/meshes
src
test
.gitignore
.travis.yml
CMakeLists.txt
LICENSE.txt
README.md
build.sh

README.md

Imgur

3D CPU Engine

Build Status

master dev
Build Status Build Status

Description

This is a simple 3D Rendering Engine using CPU for learning purpose. The main goal of this project is to understand low-level components of 3D engine. For that reason, I use few libraries and try to re-implements everything such as math library and drawing algorithms.

Features

  • Math library
    • Vectors 2
    • Vectors 3
    • Vectors 4
    • Matrix 3
    • Matrix 4
    • Matrix Transformations
      • Translation
      • Scaling
      • Rotations
      • LookAt
      • Perspective
      • Project 3D point into 2D screen
  • Mesh
    • Loading from JSON (.babylon format)
  • Rendering
    • Draw line
      • DDA algo
    • Draw filled triangle
      • Scanline Algorithm
      • Scanline Algorithm with z-buffering
      • Scanline Algorithm with z-buffering and Flat-Shading
      • Scanline Algorithm with z-buffering and Gouraud Shading
  • Render Engine
    • Render loaded meshes (By default, render Suzanne monkey)
    • Zoom in / out
  • SSE4.1 optimization (Used by math library)

Requirements

  • C++11
  • pragma once support

Dependencies

Dependencies marked with (CMake) are automatically downloaded by CMake script and placed in bin folder. Others must be installed manually (Generally system-wide install).

Build instructions

Build and run engine (CMake)

# Manual instructions
mkdir build
cd build
cmake ..
make -j2
make runEngine

# Automated script
./build.sh

Build and run tests (CMake)

mkdir build
cd build
cmake ..
make -j2
make runAllTests

# Automated script
./build.sh

Work in progress

As you may see, Gnu and Panda are working really hard on this project! Sometime, they even forget to eat the bamboo. (At least Panda, because Gnu probably prefers the emacs source code).

Imgur

Screenshots

Imgur Imgur Imgur

Author

Constantin Masson (constantinmasson.com)