asdlei99 / 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.

License

CMake MacOS CMake Windows CMake Linux

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

Clone

git clone git@github.com:keith2018/SoftGLRender.git
cd SoftGLRender
git submodule update --init --recursive

Build

mkdir build
cmake -B ./build -DCMAKE_BUILD_TYPE=Release
cmake --build ./build --config Release

Run

cd bin/Release
./SoftGLRender

License

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

About

Tiny C++ Software Renderer / Rasterizer

License:MIT License


Languages

Language:C++ 98.3%Language:CMake 1.7%