Skip to content

ZenithGD/IG-renderer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IG-renderer

A CPU renderer written in standard c++ Build Status

Installation and requirements

Just clone this repo in your machine and you're done!

Please ensure you've got a C++ compiler installation on your machine. This project uses Premake 5 as its build system, so you can customize your environment as you wish.

GNU/Makefile:

Generate the project using Premake:

premake5 gmake

After that, you can execute the Makefile:

make

You can also choose which project to build. This repo includes two projects:

  • Renderer:
make Renderer
  • Tonemapper:
make Tonemapper

Note The default makefile command builds the app with debug symbols. In order to generate production-ready and optimized builds, enter the config=release option:

make config=release

Visual Studio:

Generate the project using Premake:

premake5 vs2022

Note If you're working on VSCode, please update your .vscode/c_cpp_properties.json and include the following on your includePath to avoid annoying error highlighting:

{
    "configurations": [
        {
            ...
            "includePath": [
                ...
                "${workspaceFolder}/vendor/"
            ],
            ...
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "gnu17",
            "cppStandard": "c++17",
            ...
        }
    ],
    "version": 4
}

Other

Please refer to the Premake Docs if you need another action for your custom environment.


Usage

./bin/ToneMapper <in_file{bmp|ppm}> <out_file.{bmp|ppm}>
./bin/Renderer

Extensions

Parallel rendering

This renderer allows parallel rendering on the CPU, deferring tasks on a queue so threads can process them and return the result back. The number of threads can be chosen by hand but it is recommended to allow the maximum number of threads for peak performance.

Funny mistakes

Here are some funny rendering mistakes that we found during development:

apocalypse windows

Some spooky errors while doing local tonemapping

mickey mouse shaped thingy

A loosely familiar shape...

ufo shaped fail

UFO encounter!

---

Developer tools

Memory analysis

We all know how annoying C/C++ can be with memory management, so here's a little tool to help. First install Valgrind on your machine via package manager or from the official website. After that, execute Valgrind with the executable as an argument:

valgrind --track-origins=yes --verbose ./bin/ToneMapper

Static analysis

There are some good analysis tools for C++, such as CPPCheck. You can install this tool (On Ubuntu for example it would be sudo apt-get install cppcheck) and analyze the project with the following command:

cppcheck .

References

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •