Awesome
简要
Vulkan Samples
码云
说明
按照序号的顺序开始看,例如从2_Triangle、3_DemoBase一直到最后一个。Demo一步一步的展示了如何对Vulkan进行简单的封装以使得更加易用,如果从较高的序号开始阅读可能出现由于封装过度从而导致阅读理解困难。每一个Demo都会尽量配一个粗浅的文档,文档里面会大致说明该Demo的意图。
环境要求
Windows
- CMake 3.13.0:下载安装最新版本即可。
- Visual Studio 2017 (64位):比它高的应该也没问题。
- VulkanSDK:https://www.lunarg.com/vulkan-sdk/
MacOS
- CMake 3.13.0:下载安装最新版本即可。
- XCode 10:比它高应该也没什么问题。
- macOS 10.11 or iOS 9:因为Vulkan在苹果那边没有得到官方支持,是通过对Metal进行的封装,因此需要10.11系统以上。
Linux
- CMake 3.13.0:下载安装最新版本即可。
- Ubuntu 18.04:目前我使用的是Ubuntu 18.04系统,其它版本的没有尝试。
- VSCode:Ubuntu下我使用了VSCode作为开发环境,VSCode下Configure(Task),Build(Task),Debug我都配置好了,但是需要安装VSCode C++插件,插件名称:C/C++。
Window环境搭建
Ubuntu环境搭建
MacOS环境搭建
Android环境搭建
Introduction
Vulkan Examples
Requirements
Windows
- CMake 3.13.0
- virtual studio 2017
- VulkanSDK:https://www.lunarg.com/vulkan-sdk/
MacOS
- XCode 10
- CMake 3.13.0
- macOS 10.11 or iOS 9
Linux
- CMake 3.13.0
Android
- Android Studio 3.2
- NDK r16b
Usage
Command line
- git clone https://github.com/BobLChen/VulkanDemos.git
- cd VulkanDemos
- mkdir build
- cd build
- cmake ..
CMake-GUI
- git clone https://github.com/BobLChen/VulkanDemos.git
- Open CMake-GUI
- Where is the source code : VulkanDemos
- Where to build the binaries : VulkanDemos/build
- Click Configure button
- Choose your generator
- Click Generate button
Example
2_Triangle
3_DemoBase
4_OptimizeBuffer
5_OptimizeCommandBuffer
6_ImageGUI
7_UniformBuffer
8_OptimizeVertexIndexBuffer
9_LoadMesh
10_Pipelines
11_Texture
12_PushConstants
13_DynamicUniformBuffer
14_TextureArray
15_Texture3D
16_OptimizeShaderAndLayout
17_InputAttachments
18_SimpleDeferredShading
- Albedo:VK_FORMAT_R8G8B8A8_UNORM
- Normal:VK_FORMAT_R16G16B16A16_SFLOAT
- Position:VK_FORMAT_R16G16B16A16_SFLOAT
19_OptimizeDeferredShading
- Albedo: VK_FORMAT_R8G8B8A8_UNORM
- Normal: VK_FORMAT_R8G8B8A8_UNORM
- Position: Reconstructing world space position from depth buffer
20_Material
21_Stencil
22_RenderTarget(30 Filter)
23_OptimizeRenderTarget
24_EdgeDetect
25_Bloom
26_SkeletonMatrix4x4
27_SkeletonPackIndexWeight
- Pack 4 bone index(uint32) to 1 UInt32
- Pack 4 bone weight(float) to 2 UInt32 Reduce 5 float per vertex
28_SkeletonQuat
- Dual quat animation, reduce 8 float per bone. From matrix4x4 to 2 vector.
29_VertexTextureSkin
- Store skeleton datas in texture and used in vertex shader.