Giter VIP home page Giter VIP logo

baked-global-illumination's Introduction

Precomputed Global Illumination for Games

Game Development Practical SS18

Timothy Blut | 334609 | [email protected]

Screenshots

Project Details

  • Main goal: Precompute diffuse and specular global illumination for use in realtime rendering.
  • Shading model from Epic Games (Lambert for diffuse and GGX for specular)
    • With support for albedo, roughness and normal maps
  • Forward PBR pipeline with HDR, filmic tone mapping, bloom, PCF shadows, dithering and FXAA
  • glTF scene importer (allows Metallic/Roughness material setup)
  • Indirect diffuse lighting is solved using irradiance maps (light maps)
    • Uses Intel's Embree for efficient ray/scene intersection tests
    • Irradiance for each light map texel is computed using an unidirectional path tracer
    • The path tracer uses importance sampling and supports a background cubemap, and albedo and roughness maps (but no normal maps)
    • To allow proper bilinear filtering without shadow bleeding, each texel that is not part of a triangle is set to the closest irradiance value
    • NOTE: The scene loader expects the light map UVs to be in channel 0 (channel 1 is for albedo/roughness/normal maps)
  • Specular reflections are rendered using precomputed parallax corrected reflection probes
    • The probes are placed in a scene manually with the in-app UI
    • During the baking process the reflection maps are prefiltered using the proposed filtering method from Epic Games
    • A voxel grid that contains the three closest probes is used to determine which probes to interpolate
    • AABBs are used for parallax correction and specifying the influence region

Setup

Windows

Set the correct path to Embree 3.1 and add the bin/ directory in the Embree installation directory to the PATH variable. Open the Visual Studio solution and build.

Linux

To build the project open a terminal and run:

mkdir build
cd build
cmake ..
make -j`nproc`

Before starting the application in any way, Embree must be added to the path with source libs/embree-3.1.0.x86_64.linux/embree_vars.sh

Running

To start the application navigate to the bin directory and run, for example, ./BakedGI ./models/test2.glb ./textures/test2.lm ./textures/test2.pd.

To bake a new light map run ./BakedGI ./models/test2.glb -bake somename.lm -irr width height samples_per_pixel.

Library licenses

  • tiny_gltf.h : MIT license
  • json.hpp : Copyright (c) 2013-2017 Niels Lohmann. MIT license.
  • base64 : Copyright (C) 2004-2008 René Nyffenegger
  • stb_image.h : v2.08 - public domain image loader - Github link
  • stb_image_write.h : v1.09 - public domain image writer - Github link

Textures

All textures are taken from textures.com

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.