Skip to content

Toy Software Triangle Rasterizer Written in Intel's ISPC language

Notifications You must be signed in to change notification settings

jakubtomsu/ispc-3d-renderer

Repository files navigation

ISPC 3D Renderer

A simple and tiny software triangle rasterizer written with C/C++ and Intel's ISPC. I haven't done any major optimizations, it's a toy project just to learn about 3d graphics and ISPC.

The triangle rasterizer is heavily inspired by Fabian "ryg" Giesen's Blog Triangle rasterization in practice and Optimizing the basic rasterizer . Thanks Fabian, you're amazing!

The program renders an image on the CPU, which then gets displayed on a screen with OpenGL.

Depends on GLFW and GLAD for platform-specific code and OpenGL.

The "driver" code is in main.cpp and the actual rendering is in renderer.ispc

Features

  • Triangle rasterization with SIMD
  • Loading OBJ files with fast_obj
  • Vertex attribute interpolation (depth and normals)
  • Simple shading based on IQ's Outdoors Lighting Article
  • Display fullscreen texture with OpenGL

Screenshots

How to Build

  • Download and install the ISPC Compiler
  • In x64 VS Developer Console, run python build.py
  • The resulting executable is main.exe

TODO

Note: I consider this project more-or-less finished. I don't think I'll actually do things from this list, but who knows. I will happily merge any pull requests though.

  • Proper triangle clipping
  • Better depth encoding
  • UVs
  • Textures
  • Materials
  • Command line arguments
  • Loading other model file formats

About

Toy Software Triangle Rasterizer Written in Intel's ISPC language

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published