GithubHelp home page GithubHelp logo

hhy5277 / renderer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zauonlok/renderer

0.0 2.0 0.0 57.34 MB

A shader-based software renderer written from scratch in C89

License: MIT License

Shell 0.14% Batchfile 0.31% C 73.41% C++ 0.57% Objective-C 2.90% Python 22.66%

renderer's Introduction

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
Viewer blinn azura
Viewer blinn centaur
Viewer blinn craftsman
Viewer blinn elfgirl
Viewer blinn kgirl
Viewer blinn mccree
Viewer blinn nier2b
Viewer blinn phoenix
Viewer blinn witch
Viewer pbr assassin
Viewer pbr crab
Viewer pbr dieselpunk
Viewer pbr drone
Viewer pbr helmet
Viewer pbr junkrat
Viewer pbr ornitier
Viewer pbr ponycar
Viewer pbr sphere

References

Rendering pipeline

Physically based rendering

License

MIT

renderer's People

Contributors

zauonlok avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.