Giter Site home page Giter Site logo

jonaskris / physically-based-deferred-shading Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 1.0 290.88 MB

First attempt at writing a good looking 3D renderer. Written in C++ using OpenGL on Ubuntu.

CMake 2.98% C++ 90.09% GLSL 6.93%
pbr physically-based-shading deferred-shading opengl glad glfw cmake assimp googletest stb-image glfw3

physically-based-deferred-shading's Introduction

Table of Contents

Showcase

Left to right: Wooden cube, green toy dinosaur, lantern, bullet.

High resolution video in repository (Showcase.mov).

Features

  • Physically based and deferred shading
  • Model loading with ASSIMP
  • Image based lighting
  • Basic sort-based drawcall bucketing
  • Self-written linear algebra library

What and why

Physically based shading

Physically based shading is a method of shading that seeks to render lighting in a realistic manner.

In physically based shading, how much light is refracted or reflected is described by two components; Roughness and metalness.

The roughness component describes the amount of microscopic surface unevenness, and affects the clarity of reflections. A low roughness means the surface is smooth like a mirror, a high roughness leaves the reflection looking blurry and unclear.

The metalness component describes how much metal particles a material consists of. Because individual metal particles reflect incoming light like a mirror, a higher metalness will increase a materials reflective property.

Deferred shading

Deferred shading is a shading technique where lighting is deferred(delayed) until the very end of the rendering pipeline. With this technique, rendering is divided into two stages; the geometry stage, and the lighting stage.

During the geometry stage; position, normal, albedo, roughness, metalness and other attributes of objects are rendered into separate textures in a geometry buffer.

Lighting calculations are deferred to the second stage, where the textures in the geometry buffer are combined to produce the final image.

Cloning

The project uses googletest and assimp as submodules. To pull submodules with the project, add the argument --recurse-submodules.

git clone --recurse-submodules https://github.com/jonaskris/Physically-based-deferred-shading.git

Building

The project is compiled using CMake.

Run commands below from the main directory.

mkdir build 
cd build 
cmake .. 
make	

Testing

To run tests after building, run the command below from the build directory.

make tests

Dependencies

physically-based-deferred-shading's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

tehyy

physically-based-deferred-shading's Issues

Errors when running demo

Hi dear author,
This error suggets me to install GLSL 4.0 ? how to do that?

image

thank you
best regards
William

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.