{"id":17316812,"url":"https://github.com/saschawillems/vulkan-gltf-pbr","last_synced_at":"2025-05-14T21:04:30.561Z","repository":{"id":43175431,"uuid":"120181295","full_name":"SaschaWillems/Vulkan-glTF-PBR","owner":"SaschaWillems","description":"Physical based rendering with Vulkan using glTF 2.0 models","archived":false,"fork":false,"pushed_at":"2025-04-16T18:06:23.000Z","size":81832,"stargazers_count":1040,"open_issues_count":2,"forks_count":132,"subscribers_count":32,"default_branch":"master","last_synced_at":"2025-05-08T05:34:38.634Z","etag":null,"topics":["gltf","gltf2","pbr","vulkan"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SaschaWillems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-04T12:04:33.000Z","updated_at":"2025-05-07T16:54:24.000Z","dependencies_parsed_at":"2024-12-06T07:02:50.315Z","dependency_job_id":"84f9988a-9895-4a39-b001-b599fbdaca39","html_url":"https://github.com/SaschaWillems/Vulkan-glTF-PBR","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaschaWillems%2FVulkan-glTF-PBR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaschaWillems%2FVulkan-glTF-PBR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaschaWillems%2FVulkan-glTF-PBR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaschaWillems%2FVulkan-glTF-PBR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SaschaWillems","download_url":"https://codeload.github.com/SaschaWillems/Vulkan-glTF-PBR/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254227605,"owners_count":22035668,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gltf","gltf2","pbr","vulkan"],"created_at":"2024-10-15T13:14:20.451Z","updated_at":"2025-05-14T21:04:30.534Z","avatar_url":"https://github.com/SaschaWillems.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vulkan physically-Based Rendering using glTF 2.0 models\n\n\u003cimg src=\"./screenshots/damagedhelmet.jpg\" width=\"644px\"\u003e \u003cimg src=\"./screenshots/polly.jpg\" width=\"320px\"\u003e \u003cimg src=\"./screenshots/busterdrone.jpg\" width=\"320px\"\u003e\n\n[YouTube Vulkan glTF 2.0 playlist](https://www.youtube.com/watch?v=sl7iN-vQCOs\u0026list=PLy80eMh1-zPUz7y1JtFiS9I6H7_trBUAf)\n\n## About\n\nPhysically-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](https://github.com/KhronosGroup/glTF-WebGL-PBR) from Khronos. \n\n## glTF 2.0 Model loading\n\nModel loading is implemented in the [vkglTF::Model](./base/VulkanglTFModel.h) class, using [tiny glTF library](https://github.com/syoyo/tinygltf) 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.\n\nThe following major glTF 2.0 features are currently supported by the [vkglTF::Model](./base/VulkanglTFModel.h) class:\n\n* [x] Loading arbitrary glTF 2.0 models\n    * [x] Full node hierarchy\n    * [x] Full PBR material support\n        * [x] Metallic-Roughness workflow\n        * [x] Specular-Glossiness workflow (extension)\n    * [x] Animations   \n        * [x] Articulated (translate, rotate, scale)\n        * [x] Skinned\n        * [ ] Morph targets\n    * [x] Support for Draco mesh compression ([see instructions](#how-to-enable-draco-mesh-compression))\n\nNote 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.\n\nSupported extensions:\n\n* KHR_materials_pbrSpecularGlossiness\n* KHR_materials_unlit\n* KHR_materials_emissive_strength\n* KHR_texture_basisu\n\n## Loading different scenes\n\nThe 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](https://github.com/KhronosGroup/glTF-Sample-Models).\n\nTo load a different scene instead, specify the glTF model file name as a command line argument, e.g.:\n\n```\nVulkan-glTF-pbr \"PATH-TO-glTF-Sample-Models\\2.0\\BrainStem\\glTF\\brainstem.gltf\"\n```\n\nOn Windows the application supports drag and drop. You can simply drop a `.gltf` or `.glb` file to load onto the main window.\n\n## Texture map generation\n\nThe 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.\n\n### BRDF lookup table\n\n\u003cimg src=\"./screenshots/tex_brdflut.png\" width=\"256px\"\u003e\n\nThis 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.\n\nSee ```VulkanApplication::generateBRDFLUT()```\n\n### Irradiance cube map\n\n\u003cimg src=\"./screenshots/tex_envmap.png\" width=\"256px\"\u003e \u003cimg src=\"./screenshots/tex_irradiance_cube.png\" width=\"256px\"\u003e\n\n(*left*: front face environment cube map / *right*: front face irradiance cube map)\n\nGenerates 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.\n\nSee ```VulkanApplication::generateCubemaps()``` with target ```IRRADIANCE```\n\n### Pre-filtered (mip-mapped radiance) environment cube map\n\n\u003cimg src=\"./screenshots/tex_envmap.png\" width=\"256px\"\u003e \u003cimg src=\"./screenshots/tex_prefiltered_cube.png\" width=\"256px\"\u003e\n\n(*left*: front face environment cube map / *right*: front face prefiltered cube map)\n\nGenerates 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.\n\nComplete mip chain from *left* roughness = 0.0 to *right* roughness = 1.0:\n\n\u003cimg src=\"./screenshots/tex_prefiltered_cube_mipchain_0.png\"\u003e \u003cimg src=\"./screenshots/tex_prefiltered_cube_mipchain_1.png\"\u003e \u003cimg src=\"./screenshots/tex_prefiltered_cube_mipchain_2.png\"\u003e \u003cimg src=\"./screenshots/tex_prefiltered_cube_mipchain_3.png\"\u003e \u003cimg src=\"./screenshots/tex_prefiltered_cube_mipchain_4.png\"\u003e \u003cimg src=\"./screenshots/tex_prefiltered_cube_mipchain_5.png\"\u003e \u003cimg src=\"./screenshots/tex_prefiltered_cube_mipchain_6.png\"\u003e \u003cimg src=\"./screenshots/tex_prefiltered_cube_mipchain_7.png\"\u003e \u003cimg src=\"./screenshots/tex_prefiltered_cube_mipchain_8.png\"\u003e \u003cimg src=\"./screenshots/tex_prefiltered_cube_mipchain_9.png\"\u003e\n\n(*note:* down/up sized to same size for visualization)\n\nSee ```VulkanApplication::generateCubemaps()``` with target ```PREFILTEREDENV```\n\n## Cloning\nThis repository contains submodules for some of the external dependencies, so when doing a fresh clone you need to clone recursively:\n\n```\ngit clone --recursive https://github.com/SaschaWillems/Vulkan-glTF-PBR.git\n```\n\nUpdating submodules manually:\n\n```\ngit submodule init\ngit submodule update\n```\n\n## Building\n\nThe repository contains everything required to compile and build the examples on **Windows**, **Linux** and **Android** using a C++ compiler that supports C++14. All required dependencies are included.\n\n### Windows, Linux\n\nUse the provided CMakeLists.txt with CMake to generate a build configuration for your favorite IDE or compiler, e.g.:\n\nWindows:\n```\ncmake -G \"Visual Studio 14 2015 Win64\"\n```\n\nLinux:\n```\ncmake .\nmake\n```\n\n### Android \n\n\u003cimg src=\"./screenshots/damagedhelmet_android.jpg\" width=\"644px\"\u003e\n\n#### Prerequisites\n\n- [Android Studio Jellyfish(2023.3.1)](https://developer.android.com/studio/index.html) or higher\n- Android [NDK](https://developer.android.com/ndk/downloads/index.html)\n\n#### Building\n\n- In Android Studio, select ```Import project```\n- Select the ```android``` sub folder of the repository\n- Once import has finished the project can be build, run and debugged from Android Studio\n\nNOTE: Android SDK API version is set to 33 (Android 13).\n\n## How to enable Draco mesh compression\nIn order to enable support for loading Draco compressed glTF files you need to:\n- Clone and build https://github.com/google/draco as per their [build instructions](https://github.com/google/draco#building)\n- Copy the Draco decoder library ```dracodec.lib``` into ```libs\\draco```\n- Copy the ```src``` folder contents into ```external\\draco```, make sure the ```draco_features.h``` is also present\n- If everything is in place, running CMake will output ```Draco mesh compression enabled``` and loading Draco compressed meshes will work out of the box\n\n## Links\n* [glTF format specification](https://github.com/KhronosGroup/glTF)\n* [glTF V2.0 Sample Models](https://github.com/KhronosGroup/glTF-Sample-Assets)\n* [tiny glTF library](https://github.com/syoyo/tinygltf)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaschawillems%2Fvulkan-gltf-pbr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaschawillems%2Fvulkan-gltf-pbr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaschawillems%2Fvulkan-gltf-pbr/lists"}