Skip to content

C++ port of foolrenderer. A tiny software renderer implemented from scratch without the use of graphics API, used to understand how GPUs work.

License

Notifications You must be signed in to change notification settings

Morphlng/foolrenderer_Cpp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

foolrenderer

teaser image

About this repo

This is a C++17 version port of the C99 software renderer project foolrenderer. The idea is to take full advantage of the conveniences C++ offers, such as RAII, OOP style struct accessing, much more flexible api (based on templates and containers).

The work is still a WIP (in terms of completely rewrite the code to C++ style), but it can already compile and render correctly.

I'm working on Windows with VS2022, so currently I'm only providing you with the .SLN solution, CMAKE version will come soon.

About foolrenderer

foolrenderer is a tiny software renderer implemented from scratch without the use of graphics API, used to understand how GPUs work. The primary goal for foolrenderer is to demonstrate some real-time rendering techniques for video games.

  • Small. Only a few thousand lines of code, no complex dependencies.
  • Simple. Focus on the fundamentals of rendering.
  • Readable. A quarter of the source code is comments, and every mathematical calculation has a formula explanation.

⛳ Prerequisites

To build foolrenderer, you must first install the following tools:

Windows

  • Visual Studio 2019 version 16.2 (or more recent)
  • CMake 3.21 (or more recent)

Make sure your Visual Studio has Clang compiler tools installed. If you don't already have the tools, you can install them by opening the Visual Studio Installer and choosing C++ Clang tools for Windows under Desktop development with C++ optional components.

macOS

  • Xcode 12.3 (or more recent)
  • CMake 3.21 (or more recent)

After installing Xcode you need to make sure the command line tools are set up by running:

$ xcode-select --install

🚀 Build and Run

The following shows how to build and run foolrenderer from the command line.

Some editors and IDEs (like VSCode, CLion, Visual Studio) support editing, building and debugging CMake projects. Please refer to related documents for usage.

Build

First, create a build folder in the project root directory. Then use CMake commands to build the project:

$ cd foolrenderer
$ mkdir build
$ cd build
$ cmake ..
$ cmake --build .

Run

If the build is successful, you can run the generated executable in the build directory. foolrenderer will store the rendering result in a TGA format image.

🏆 Features Showcase

rasterization

draw model

gamma correction

pbr materials

🤔 How to Learn Computer Graphics

Here are some useful tutorials for self-study computer graphics. You can also find links to the corresponding literature at each algorithm in the source code.

Getting Started

Advanced

Physically Based Rendering

❤️ License

Copyright (c) Caden Ji. All rights reserved.

Licensed under the MIT license.

About

C++ port of foolrenderer. A tiny software renderer implemented from scratch without the use of graphics API, used to understand how GPUs work.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 74.1%
  • C 24.3%
  • Makefile 1.6%