gmh5225 / Renderer-SoftGLRender

Tiny C++ Software Renderer/Rasterizer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SoftGLRender

Tiny C++ Software Renderer/Rasterizer, it implements the main GPU rendering pipeline, 3D models (GLTF) are loaded by assimp, and using GLM as math library.

Features

  • Wireframe
  • View Frustum culling
  • Back-Front culling
  • Orbit Camera Controller
  • Perspective Correct Interpolation
  • Reversed Z
  • Early Z
  • Tangent Space Normal Mapping
  • Basic Lighting
  • Blinn-Phong shading
  • PBR & IBL shading
  • Skybox CubeMap & Equirectangular
  • Texture mipmaps
  • Texture tiling and swizzling (linear, tiled, morton)
  • Texture filtering and warping
  • Shader varying partial derivative dFdx dFdy
  • Alpha mask & blend

Texture Filtering

  • NEAREST
  • LINEAR
  • NEAREST_MIPMAP_NEAREST
  • LINEAR_MIPMAP_NEAREST
  • NEAREST_MIPMAP_LINEAR
  • LINEAR_MIPMAP_LINEAR

Texture Warping

  • REPEAT
  • MIRRORED_REPEAT
  • CLAMP_TO_EDGE
  • CLAMP_TO_BORDER
  • CLAMP_TO_ZERO

Texture Fetch

  • Lod
  • Bias
  • Offset

Anti Aliasing

  • SSAA
  • FXAA

TODO

  • MSAA\TAA
  • Shadow Map

Showcase

Render Textured

  • BoomBox (PBR)

  • Robot

  • DamagedHelmet (PBR)

  • GlassTable

  • AfricanHead

  • Brickwall

  • Cube

Render Wireframe

Check "show clip" to show the triangles created by frustum clip

Dependencies

Build

mkdir build
cd build
cmake ..
make

Run

cd bin
./SoftGLRender

License

This code is licensed under the MIT License (see LICENSE).

About

Tiny C++ Software Renderer/Rasterizer

License:MIT License


Languages

Language:C++ 71.4%Language:C 27.9%Language:Objective-C 0.5%Language:CMake 0.1%Language:Makefile 0.0%