Skip to content

Latest commit

 

History

History
80 lines (63 loc) · 2.27 KB

File metadata and controls

80 lines (63 loc) · 2.27 KB

Dual Rasterizer

A software (CPU) and hardware (GPU) rasterizer built with C++ and DirectX 11. You can switch between both rasterizers at runtime and change various render settings on the fly.

Table of Contents

Screenshots

Software Rasterizer

Software rasterizer - combined shading

Hardware Rasterizer

Hardware rasterizer - with fire mesh

Debug Views

Depth buffer visualization Bounding box visualization

Features

Software Rasterizer

  • Full rasterization pipeline on the CPU (vertex transformation, triangle rasterization, depth testing, pixel shading)
  • Lambert diffuse + Phong specular shading (BRDF)
  • Normal mapping
  • Multiple shading/debug modes: observed area, diffuse only, specular only, combined
  • Depth buffer visualization
  • Bounding box visualization

Hardware Rasterizer

  • DirectX 11 rendering pipeline
  • HLSL pixel shading (same lighting model as software)
  • Texture sampling modes: point, linear, anisotropic

Shared

  • Toggle between software and hardware rasterizer (F1)
  • Cull mode cycling: back, front, none
  • Camera with mouse look and keyboard movement
  • OBJ mesh loading with diffuse, normal, specular and glossiness textures
  • Custom math library (vectors, matrices)
  • Fire mesh with partial coverage (alpha blending)

Controls

Camera
WASD / Arrows: Move
LShift: Sprint
RMB: Rotate
LMB: Rotate horizontally, move forward/backward
RMB + LMB: Move up/down

Settings
F1: Toggle software/hardware rasterizer
F2: Toggle rotation
F3: Toggle fire mesh
F4: Cycle sampler state (hardware only)
F5: Cycle shading mode (software only)
F6: Toggle normal mapping (software only)
F7: Toggle depth buffer display (software only)
F8: Toggle bounding boxes (software only)
F9: Cycle cull mode
F10: Toggle uniform clear color
F11: Toggle FPS display

Building

The project uses CMake.

cmake -S . -B build
cmake --build build

Requires the DirectX 11 SDK (Windows).