这是indexloc提供的服务,不要输入任何密码
Skip to content

vfx-fuhao/renderer

Repository files navigation

Software Renderer

This is a shader-based software renderer written from scratch. It is written in C89 with minimal dependencies, available for Windows, macOS, and Linux.

Features

  • Cross-platform (Windows, macOS, and Linux)
  • Minimal dependencies
  • Shader-based
  • Real-time
  • Blinn–Phong reflection model
  • Physically based rendering (PBR)
  • Metalness workflow
  • Specular workflow
  • Image-based lighting (IBL)
  • Normal mapping
  • Shadow mapping
  • Cubemapped skybox
  • Skeletal animation
  • Orbit camera control
  • Back-face culling
  • Homogeneous clipping
  • Perspective-correct interpolation
  • Depth testing
  • Alpha testing
  • Alpha Blending
  • Mesh loading (obj, gltf)
  • Image loading (tga, hdr)

Download

Binaries for Windows, macOS, and Linux are available.

Build

To build the renderer from source, a C89 compiler and development files for your window system are required.

Windows

Install Visual Studio and run build_win32.bat.

macOS

Install Xcode and run build_macos.sh.

Linux

Install GCC and Xlib with the following commands and run build_linux.sh.

Ubuntu / Debian

sudo apt install gcc libx11-dev

Fedora / RHEL

sudo dnf install gcc libX11-devel

openSUSE / SUSE

sudo zypper install gcc libX11-devel

Usage

Launch

If the renderer is launched without arguments, one of the available scenes (see below) will be chosen randomly. To display a specific scene, additional arguments should be supplied. The command line syntax is:

Viewer [test_name [scene_name]]

Controls

  • Orbit: left click and drag
  • Pan: right click and drag
  • Zoom: scroll up or down
  • Rotate lighting: A D S W
  • Reset everything: Space

Samples

Scene Screenshot Command
Azura Viewer blinn azura
Centaur Viewer blinn centaur
Craftsman Viewer blinn craftsman
Elf Girl Viewer blinn elfgirl
Kgirl Viewer blinn kgirl
McCree Viewer blinn mccree
NieR 2B Viewer blinn nier2b
Phoenix Viewer blinn phoenix
Witch Viewer blinn witch
Assassin Viewer pbr assassin
Crab Viewer pbr crab
Dieselpunk Viewer pbr dieselpunk
Drone Viewer pbr drone
Helmet Viewer pbr helmet
Junkrat Viewer pbr junkrat
Ornitier Viewer pbr ornitier
Pony Car Viewer pbr ponycar
Spheres Viewer pbr sphere

License

MIT

About

A shader-based software renderer written from scratch in C89

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 69.0%
  • Python 26.0%
  • Objective-C 2.8%
  • CMake 1.2%
  • C++ 0.6%
  • Batchfile 0.3%
  • Shell 0.1%