/SoftGLRender

Tiny C++ Software Renderer/Rasterizer

Primary LanguageC++MIT LicenseMIT

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 wrapping
  • 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 Wrapping

  • 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).