Skip to content

Sopiro/SoftwareRenderer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Software Renderer

This is a 3D Software renderer implemented in HTML canvas using vanilla javascript.
No WebGL, No external library used!

Live Demo: https://sopiro.github.io/SoftwareRenderer/
Video: https://youtu.be/EGpyw_Su2r0

Examples

Post processing effects Normal mapping
img1 img2
Line and triangle Flat and smooth shaded spheres
img3 img4
Normal mapped cube 1 Normal mapped cube 2
img5 img6
Normal mapped barrel Textured cubes and Blender Suzanne
img7 img8
Diablo model with normal mapping Diablo model without normal mapping
img9 img10

Features

  • Point and line rendering
  • Triangle rasterization
  • Depth buffering
  • Clipping for near plane
  • Back face culling
  • Indexed mesh rendering
  • Texture mapping
  • OBJ model loading
    • Calculate face normal and tangent vectors
  • Vertex and fragment shading
  • Perspective projection, viewport transform
  • Phong shading model
    • Directional light
  • Normal mapping
  • Post-processing effects
  • Skybox rendering