32

GitHub - zauonlok/renderer: A shader-based software renderer written from scratc...

 5 years ago
source link: https://github.com/zauonlok/renderer
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

README.md

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
  • Blinn–Phong reflection model
  • Physically based rendering (PBR)
  • Metalness workflow
  • Specular workflow
  • Image-based lighting (IBL)
  • Tangent space 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
  • Platform abstraction layer (window, event, and timer)
  • Math library (vector, matrix, and quaternion)
  • 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 will be chosen randomly. To display a specific scene (see below), 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

Screenshots

Scene Command screenshot.png Viewer blinn azura screenshot.png Viewer blinn centaur screenshot.png Viewer blinn craftsman screenshot.png Viewer blinn elfgirl screenshot.gif Viewer blinn kgirl screenshot.png Viewer blinn mccree screenshot.png Viewer blinn nier2b screenshot.gif Viewer blinn phoenix screenshot.png Viewer blinn witch screenshot.gif Viewer pbr assassin screenshot.gif Viewer pbr crab screenshot.png Viewer pbr dieselpunk screenshot.gif Viewer pbr drone screenshot.png Viewer pbr helmet screenshot.gif Viewer pbr junkrat screenshot.png Viewer pbr ornitier screenshot.png Viewer pbr ponycar screenshot2.png Viewer pbr sphere

References

License

MIT


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK