Skip to content

A software 3D model renderer of 2k lines of code, with ray tracing and phong shading support.

License

Notifications You must be signed in to change notification settings

wangyu-/soft-renderer

Repository files navigation

mini-soft-renderer

image

A software 3D model renderer of 2k lines of code, features include:

All features are implemented from scratch, xlib is the only dependent library. xlib is used only for drawing pixels.

How to use

1 build with make:
make

(you might need to install libx11-dev before this step)

2 run the program:
./render model/teapot.obj 800x600               # 800x600 is the resolution, can be omitted
3 controls
use `wsad` and `q` `e` to rotate about 3 axes
use ARROW keys to move
use `+` `-` to scale
use `r` to toggle ray tracing
use `p` to toggle phong soomthing
use `b` to toggle bump mapping
use 'z' to toggle between wireframe/z-buffer mode
use 'v' to toggle between orthogonal/perspective view

Screenshots

image image image

image image

image image

image

image image image image

About

A software 3D model renderer of 2k lines of code, with ray tracing and phong shading support.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages