All Projects → SaschaWillems → Vulkan Gltf Pbr

SaschaWillems / Vulkan Gltf Pbr

Licence: mit
Physical based rendering with Vulkan using glTF 2.0 models

Projects that are alternatives of or similar to Vulkan Gltf Pbr

Wickedengine
3D engine focusing on modern rendering techniques and performance.
Stars: ✭ 3,148 (+618.72%)
Mutual labels:  vulkan, pbr, gltf
Vk raytrace
Ray tracing glTF scene with Vulkan
Stars: ✭ 91 (-79.22%)
Mutual labels:  vulkan, pbr, gltf
Filament
Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2
Stars: ✭ 13,215 (+2917.12%)
Mutual labels:  vulkan, pbr
Yave
Yet Another Vulkan Engine
Stars: ✭ 211 (-51.83%)
Mutual labels:  vulkan, pbr
Lugdunum
[UNMAINTAINED] A modern cross-platform 3D engine built with Vulkan, glTF 2.0 and modern C++14.
Stars: ✭ 230 (-47.49%)
Mutual labels:  vulkan, pbr
Pbr
An implementation of physically based shading & image based lighting in D3D11, D3D12, Vulkan, and OpenGL 4.
Stars: ✭ 722 (+64.84%)
Mutual labels:  vulkan, pbr
Code Vr
🐍 Program and explore real applications with virtual reality! Learn how to program, compete to build apps, and even collaborate with other people in realtime, in game or not!
Stars: ✭ 131 (-70.09%)
Mutual labels:  vulkan, gltf
Diligentengine
A modern cross-platform low-level graphics library and rendering framework
Stars: ✭ 2,142 (+389.04%)
Mutual labels:  vulkan, pbr
redcube
JS renderer based on GLTF to WebGPU or WebGL backends.
Stars: ✭ 86 (-80.37%)
Mutual labels:  pbr, gltf
rendering-fw
Rendering framework with rasterizers & path tracers implemented using Vulkan, OptiX & OpenGL
Stars: ✭ 81 (-81.51%)
Mutual labels:  vulkan, gltf
Nabla
OpenGL/OpenGL ES/Vulkan/CUDA/OptiX Modular Rendering Framework for PC/Linux/Android
Stars: ✭ 235 (-46.35%)
Mutual labels:  vulkan, pbr
Gltf
A crate for loading glTF 2.0
Stars: ✭ 224 (-48.86%)
Mutual labels:  pbr, gltf
Maya2gltf
Maya to glTF 2.0 exporter
Stars: ✭ 203 (-53.65%)
Mutual labels:  pbr, gltf
Gltf To Usdz Research
Research and proof of concept of converting glTF to USDZ for AR Quick Look (iOS 12+).
Stars: ✭ 164 (-62.56%)
Mutual labels:  pbr, gltf
MoravaEngine
2D/3D graphics engine written in C++ language. It currently supports the following graphics APIs: OpenGL 3.3+, Vulkan 1.2, DirectX 11. Its current purpose is to experiment with various CG concepts and techniques.
Stars: ✭ 129 (-70.55%)
Mutual labels:  vulkan, pbr
Minimal Gltf Loader
A minimal, engine-agnostic JavaScript glTF Loader.
Stars: ✭ 148 (-66.21%)
Mutual labels:  pbr, gltf
harfang3d
HARFANG 3D source code public repository
Stars: ✭ 173 (-60.5%)
Mutual labels:  vulkan, pbr
tokonoma
Graphics related projects/prototypes/playground (Vulkan, C++17)
Stars: ✭ 23 (-94.75%)
Mutual labels:  vulkan, pbr
Quartz
Vulkan RTX path tracer with a declarative ES7-like scene description language.
Stars: ✭ 367 (-16.21%)
Mutual labels:  vulkan, pbr
Realsr Ncnn Vulkan
RealSR super resolution implemented with ncnn library
Stars: ✭ 357 (-18.49%)
Mutual labels:  vulkan

Vulkan physically-Based Rendering using glTF 2.0 models

YouTube Vulkan glTF 2.0 playlist

About

Physically-Based Rendering example implementation with image based lighting in Vulkan using glTF 2.0 models. The lighting equation is based on the reference glTF PBR implementation from Khronos.

glTF 2.0 Model loading

Model loading is implemented in the vkglTF::Model class, using tiny glTF library to import the glTF 2.0 files, so e.g. all file formats supported by tinyglTF are suported. This class converts the glTF structures into Vulkan compatible structures used for setup and rendering.

The following major glTF 2.0 features are currently supported by the vkglTF::Model class:

  • [x] Loading arbitrary glTF 2.0 models
    • [x] Full node hierarchy
    • [x] Full PBR material support
      • [x] Metallic-Roughness workflow
      • [x] Specular-Glossiness workflow (extension)
    • [x] Animations
      • [x] Articulated (translate, rotate, scale)
      • [x] Skinned
      • [ ] Morph targets
    • [x] Support for Draco mesh compression (see instructions)

Note that the model loader does not fully implement all aspects of the glTF 2.0 standard, and as such there is no guarantee that all glTF 2.0 models work properly.

Loading different scenes

The repository only includes a basic scene setup with the static "damaged helmet" pbr sample model. The official collection of glTF 2.0 sample models can be found at here.

To load a different scene instead, specify the glTF model file name as a command line argument, e.g.:

Vulkan-glTF-pbr "PATH-TO-glTF-Sample-Models\2.0\BrainStem\glTF\brainstem.gltf"

Texture map generation

The physical based render model uses multiple source images for the lighting equation. Instead of relying on offline tools to generate those, this example will generate all required texture maps during startup using the GPU.

BRDF lookup table

This pass generates a 2D BRDF lookup table based on the formulas used in the pbr implementation. The lookup table contains BRDF values for roughness and view angle and is stored as a 16-bit per component floating point texture to provide proper precision.

See VulkanExample::generateBRDFLUT()

Irradiance cube map

(left: front face environment cube map / right: front face irradiance cube map)

Generates a small (64 x 64 px) irradiance cube map from that stores the light radiated from the surrounding environment. This is sampled for the indirect diffuse part of the lighting equation.

See VulkanExample::generateCubemaps() with target IRRADIANCE

Pre-filtered (mip-mapped radiance) environment cube map

(left: front face environment cube map / right: front face prefiltered cube map)

Generates a pre-filtered radiance cube map that is sampled for the indirect specular part of the lighting equation and stores specular contribution based on roughness. The mip chain stores increasing roughness values with increasing level count and is sampled accordingly when rendering the object.

Complete mip chain from left roughness = 0.0 to right roughness = 1.0:

(note: down/up sized to same size for visualization)

See VulkanExample::generateCubemaps() with target PREFILTEREDENV

Cloning

This repository contains submodules for some of the external dependencies, so when doing a fresh clone you need to clone recursively:

git clone --recursive https://github.com/SaschaWillems/Vulkan-glTF-PBR.git

Updating submodules manually:

git submodule init
git submodule update

Building

The repository contains everything required to compile and build the examples on Windows, Linux and Android using a C++ compiler that supports C++11. All required dependencies are included.

Windows, Linux

Use the provided CMakeLists.txt with CMake to generate a build configuration for your favorite IDE or compiler, e.g.:

Windows:

cmake -G "Visual Studio 14 2015 Win64"

Linux:

cmake .
make

Android

Prerequisites

Building

  • In Android Studio, select Import project
  • Select the android sub folder of the repository
  • Once import has finished the project can be build, run and debugged from Android Studio

How to enable Draco mesh compression

In order to enable support for loading Draco compressed glTF files you need to:

  • Clone and build https://github.com/google/draco as per their build instructions
  • Copy the Draco decoder library dracodec.lib into libs\draco
  • Copy the src folder contents into external\draco, make sure the draco_features.h is also present
  • If everything is in place, running CMake will output Draco mesh compression enabled and loading Draco compressed meshes will work out of the box

Links

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].