# foolrenderer_Cpp **Repository Path**: Morphlng/foolrenderer_Cpp ## Basic Information - **Project Name**: foolrenderer_Cpp - **Description**: 使用C++17重写的foolrenderer,一个基于纯软件的图形渲染器 - **Primary Language**: C++ - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-07-28 - **Last Updated**: 2022-08-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # foolrenderer_Cpp ![teaser image](docs/teaser.gif) ## 关于本项目 [foolrenderer](https://github.com/cadenji/foolrenderer)是一个不依赖任何图形API,从零实现的一个小型软件渲染器。该项目的初衷是演示部分电子游戏领域常用的实时渲染技术。 原项目是一个基于C99标准的纯C项目,代码格式标准、文档规范。但受限于C语言本身,其源码在我一个应用程序员看来非常啰嗦,对于堆内存的管理依赖于程序员而不是代码本身,最重要的是MSVC对于C99标准并没有完全支持,由于其源码使用了VLA等特性,使用MSVC编译器无法直接编译运行。 因此,我创建了本项目,使用C++17重构了代码,称为**foolrenderer_Cpp**。我们通过充分利用C++带来的RAII、面向对象模型、模板与容器,大幅优化了项目代码,使其更易读、更灵活。 本项目目前仍处于工作阶段,尚未将所有代码按C++风格重写,部分接口仍可能修改。但现已可以编译,并正确渲染图像。 ## About foolrenderer - **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. ## ⛳ Build Since I'm working on Windows with Visual Studio 2022, I only provide you with a .SLN solution. Theoretically, Visual Studio 2017+ should be able to compile with C++17 standard set, but you'll have to manually change the windows sdk or other stuff. I'll provide a CMAKE version after the project is settled. ## 🏆 Features Showcase ![rasterization](docs/rasterization.jpg) ![draw model](docs/draw_model.jpg) ![gamma correction](docs/gamma_correction.jpg) ![pbr materials](docs/pbr_materials.jpg) ## 🤔 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 - [Grant Sanderson 2016, Essence of linear algebra](https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab) - Learning graphics requires knowing the basic concepts of linear algebra, and this series of videos will help you enjoy mastering vectors, matrices and other mathematical tools. - [Dmitry V. Sokolov 2015, Tiny renderer or how OpenGL works: software rendering in 500 lines of code](https://github.com/ssloy/tinyrenderer) - An excellent introductory course in computer graphics. After taking this course you will find that learning OpenGL has become a lot easier. - [Lingqi Yan 2020, GAMES101: Introduction to Computer Graphics (Chinese course)](https://sites.cs.ucsb.edu/~lingqi/teaching/games101.html) - Courses cover rasterization, geometry, ray tracing and animation. If you are a Chinese speaker, this course can help you get started quickly. ### Advanced - [Joey de Vries 2014, LearnOpenGL](https://learnopengl.com/) - When you master the basics of graphics, you can easily get started with graphics APIs such as OpenGL. You can learn advanced features like Shadow Mapping, Gamma Correction, Normal Mapping, HDR, SSAO and more in this course. - [Lingqi Yan 2021, GAMES202: Real-Time High Quality Rendering (Chinese course)](https://sites.cs.ucsb.edu/~lingqi/teaching/games202.html) - The course introduces many real-time rendering techniques widely adopted by the industry, such as shadows, environment mapping, global illumination, physically based shading, real-time ray tracing, etc. - [Grant Sanderson 2017, Essence of calculus](https://www.youtube.com/playlist?list=PLZHQObOWTQDMsr9K-rj53DwVRMYO3t5Yr) - Watching this series of videos will at least help you understand the rendering equation. ### Physically Based Rendering - [Naty Hoffman 2013, Background: Physics and Math of Shading](https://blog.selfshadow.com/publications/s2013-shading-course/hoffman/s2013_pbs_physics_math_notes.pdf) - [Shree K. Nayar 2021, Radiometry and Reflectance](https://www.youtube.com/playlist?list=PL2zRqk16wsdpyQNZ6WFlGQtDICpzzQ925) - The first 7 videos of this play list are helpful for understanding Radiometry and BRDF. - [Charles de Rousiers & Sébastian Lagarde 2014, Moving Frostbite to PBR](https://www.ea.com/frostbite/news/moving-frostbite-to-pb) - The EA DICE team detailed the PBR implementation of the Frostbite engine in this course. Hope the *Battlefield 2042* update goes well. - [Romain Guy & Mathias Agopian 2018, Physically Based Rendering in Filament](https://google.github.io/filament/Filament.html) ## ❤️ License Copyright (c) Caden Ji. All rights reserved. Licensed under the [MIT](LICENSE) license.