• Stars
    star
    698
  • Rank 64,841 (Top 2 %)
  • Language
    C++
  • License
    MIT License
  • Created almost 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Some simple vulkan examples.

简要

Vulkan Samples

码云

码云地址

说明

按照序号的顺序开始看,例如从2_Triangle3_DemoBase一直到最后一个。Demo一步一步的展示了如何对Vulkan进行简单的封装以使得更加易用,如果从较高的序号开始阅读可能出现由于封装过度从而导致阅读理解困难。每一个Demo都会尽量配一个粗浅的文档,文档里面会大致说明该Demo的意图。

环境要求

Windows

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

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

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

博客地址 2_Triangle

3_DemoBase

博客地址

4_OptimizeBuffer

博客地址

5_OptimizeCommandBuffer

博客地址

6_ImageGUI

博客地址 6_ImageGUI

7_UniformBuffer

博客地址 7_UniformBuffer

8_OptimizeVertexIndexBuffer

博客地址

9_LoadMesh

博客地址 9_LoadMesh

10_Pipelines

博客地址 10_Pipelines

11_Texture

博客地址 11_Texture

12_PushConstants

博客地址 12_PushConstants

13_DynamicUniformBuffer

博客地址 13_DynamicUniformBuffer

14_TextureArray

博客地址 14_TextureArray

15_Texture3D

博客地址 15_Texture3D

16_OptimizeShaderAndLayout

博客地址

17_InputAttachments

17_InputAttachments

18_SimpleDeferredShading

博客地址

  • Albedo:VK_FORMAT_R8G8B8A8_UNORM
  • Normal:VK_FORMAT_R16G16B16A16_SFLOAT
  • Position:VK_FORMAT_R16G16B16A16_SFLOAT 18_DeferredShading

19_OptimizeDeferredShading

博客地址

  • Albedo: VK_FORMAT_R8G8B8A8_UNORM
  • Normal: VK_FORMAT_R8G8B8A8_UNORM
  • Position: Reconstructing world space position from depth buffer 19_OptimizeDeferredShading

20_Material

博客地址

21_Stencil

博客地址 21_Stencil

22_RenderTarget(30 Filter)

博客地址 22_RenderTarget

23_OptimizeRenderTarget

博客地址

24_EdgeDetect

博客地址 24_EdgeDetect

25_Bloom

博客地址 25_Bloom

26_SkeletonMatrix4x4

博客地址 26_Skeleton

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. 28_SkeletonDualQuat

29_VertexTextureSkin

博客地址

  • Store skeleton datas in texture and used in vertex shader.

30_InstanceSkin

30_InstanceSkin

31_MSAA

31_MSAA

32_FXAA

32_FXAA

33_InstanceDraw

33_InstanceDraw

34_SimpleShadow

34_SimpleShadow

35_PCFShadow

35_PCFShadow

36_OmniShadow(Multiview)

36_OmniShadow

37_CascadedShadow

37_CascadedShadow

38_IndirectDraw

38_IndirectDraw

39_OcclusionQueries

39_OcclusionQueries

40_QueryStatistics

40_QueryStatistics

41_ComputeShader

41_ComputeShader

42_OptimizeComputeShader

43_ComputeParticles

43_ComputeParticles

44_ComputeRaytracing

44_ComputeRaytracing

45_ComputeFrustum

45_ComputeFrustum

46_GeometryHouse

46_GeometryHouse

47_DebugNormal

47_DebugNormal

48_GeometryOmniShadow

48_GeometryOmniShadow

49_SimpleTessellation

49_SimpleTessellation

50_PNTessellation

50_PNTessellation

51_Pick

51_Pick

52_HDRPipeline

52_HDRPipeline

53_SSAO

53_SSAO

54_ThreadedRendering

54_ThreadedRendering

55_PBR_DirectLighting

55_PBR_DirectLighting

56_PBR_IBL

56_PBR_IBL

57_GodRay

57_GodRay

58_Imposter

58_Imposter

59_MotionBlur

59_MotionBlur

60_DepthPeeling

60_DepthPeeling

61_CPURayTracing

61_CPURayTracing

62_RTXRayTracingBasic

62_RTXRayTracingBasic

63_RTXRayTracingMesh

63_RTXRayTracingMesh

64_RTXRayTracingSimple

64_RTXRayTracingSimple

65_RTXRayTracingReflection

65_RTXRayTracingReflection

66_RTXRayTracingHitGroup

66_RTXRayTracingHitGroup

67_RTXRayTracingMonteCarlo

67_RTXRayTracingMonteCarlo

68_RTXPathTracing

68_RTXPathTracing

69_TileBasedForwardRendering

69_TileBasedForwardRendering

70_SDFFont

70_SDFFont

71_ShuffleIntrinsics

71_ShuffleIntrinsics

72_MeshLOD

72_MeshLOD