• Stars
    star
    496
  • Rank 86,969 (Top 2 %)
  • Language
    C++
  • License
    Apache License 2.0
  • Created over 4 years ago
  • Updated 3 months ago

Reviews

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

Repository Details

Ray tracing glTF scene with Vulkan

VK_RAYTRACE

vk_raytrace

This project is a glTF 2.0 sample viewer using Vulkan ray tracing. It follows the ray tracing tutorial and combines all chapters into a single example.

The lighting equation is based on:

The rendering pipeline can be switched from:

  • RTX: RayGen, Closest-Hit, Miss, Any-Hit model
  • Compute: using Ray Query

Features

  • Load glTF 2.0 files ascii and binary using tiny glTF
  • Support for full node hierarchy
  • Full implementation of metallic-roughness and specular-glossiness
  • IBL lighting using importance light sampling
  • Alpha blend and cut-out
  • Texture transforms and samplers

Attributes

  • Normal : create geometric normal when not present
  • Texture coords : only set 0, project cube map when text coords are missing.
  • Tangents : generate tangents and bitangent when missing.
  • Color : default (1,1,1,1)

Extensions

Usage

Controls

Action Description
LMB Rotate around the target
RMB Dolly in/out
MMB Pan along view plane
LMB + Shift Dolly in/out
LMB + Ctrl Pan
LMB + Alt Look around
Mouse wheel Dolly in/out
Mouse wheel + Shift Zoom in/out (FOV)
Space Set interest point on the surface under the mouse cursor.
F10 Toggle UI pane.

Change glTF model

  • Drag and drop glTF files (.gltf or .glb) into viewer

Change HDR lighting

  • Drag and drop HDR files (.hdr) into viewer

Setup

git clone --recursive --shallow-submodules https://github.com/nvpro-samples/nvpro_core.git
git clone https://github.com/nvpro-samples/vk_raytrace.git

Other

Tags:

  • raytracing, GLTF, HDR, tonemapper, picking, BLAS, TLAS, PBR material

Extensions:

  • VK_KHR_RAY_QUERY_EXTENSION_NAME
  • VK_KHR_RAY_TRACING_PIPELINE_EXTENSION_NAME
  • VK_KHR_ACCELERATION_STRUCTURE_EXTENSION_NAME
  • VK_KHR_SHADER_CLOCK_EXTENSION_NAME
  • VK_KHR_MAINTENANCE3_EXTENSION_NAME
  • VK_KHR_PIPELINE_LIBRARY_EXTENSION_NAME
  • VK_KHR_DEFERRED_HOST_OPERATIONS_EXTENSION_NAME
  • VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME
  • VK_EXT_SCALAR_BLOCK_LAYOUT_EXTENSION_NAME
  • VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME
  • VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME
  • VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME
  • VK_KHR_SWAPCHAIN_EXTENSION_NAME
  • VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME
  • VK_EXT_DEBUG_UTILS_EXTENSION_NAME
  • VK_KHR_SURFACE_EXTENSION_NAME

Links


Test Scenes

Model Link
2 Cylinder Engine
Alpha Blending
Anisotropy
Antique Camera
Boom Box
Carbon Fiber
Clear Coat
Corset
Damaged Helmet
Flight Helmet
Metal Rough Spheres
Punctual Light
SciFi
SpecGlossVsMetalRough
Unlit
Transmission
Box Vertex Color

More Repositories

1

vk_raytracing_tutorial_KHR

Ray tracing examples and tutorials using VK_KHR_ray_tracing
C++
1,261
star
2

vk_mini_path_tracer

A beginner-friendly Vulkan path tracing tutorial in under 300 lines of C++.
C++
1,069
star
3

gl_occlusion_culling

OpenGL sample for shader-based occlusion culling
C++
511
star
4

nvpro_core

shared source code and resources needed for the samples to run
C++
429
star
5

optix_advanced_samples

C
408
star
6

gl_ssao

optimized screen-space ambient occlusion, cache-aware hbao
C++
333
star
7

gl_vk_meshlet_cadscene

This OpenGL/Vulkan sample illustrates the use of "mesh shaders" for rendering CAD models.
C++
326
star
8

build_all

GO HERE FIRST: nvpro-samples overview
Batchfile
300
star
9

vk_order_independent_transparency

Demonstrates seven different techniques for order-independent transparency in Vulkan.
C++
245
star
10

vk_video_samples

Vulkan video samples
C++
223
star
11

gl_vk_chopper

Simple vulkan rendering example.
C++
204
star
12

vk_mini_samples

Collection of Vulkan samples
CMake
177
star
13

vk_raytracing_tutorial_NV

Vulkan ray tracing examples and tutorials using VK_NV_ray_tracing
C++
159
star
14

gl_vk_threaded_cadscene

OpenGL and Vulkan comparison on rendering a CAD scene using various techniques
C++
157
star
15

gl_cadscene_rendertechniques

OpenGL sample on various rendering approaches for typical CAD scenes
C++
147
star
16

gl_commandlist_basic

OpenGL sample for NV_command_list
C++
112
star
17

vk_displacement_micromaps

This sample showcases rasterizing and ray tracing displaced NVIDIA Micro-Mesh assets in Vulkan with and without the VK_NV_displacement_micromap extension.
C++
89
star
18

vk_denoise

Denoising a Vulkan ray traced image using OptiX denoiser
C++
87
star
19

gl_vk_bk3dthreaded

Vulkan sample rendering 3D with 'worker-threads'
C++
86
star
20

gl_vk_simple_interop

Display an image created by Vulkan compute shader, with OpenGL
C++
75
star
21

vk_shaded_gltfscene

Rendering glTF scenes with ray tracer and raster (Vulkan)
C++
74
star
22

vk_toon_shader

Silhouette and toon shading post-processing with Vulkan
C++
73
star
23

gl_dynamic_lod

GPU classifies how to render millions of particles
C++
69
star
24

gl_vk_supersampled

Vulkan sample showing a high quality super-sampled rendering
C++
64
star
25

nvtt_samples

NVIDIA Texture Tools samples for compression, image processing, and decompression.
C++
61
star
26

optix_prime_baking

Shows how to bake ambient occlusion at mesh vertices using OptiX Prime
45
star
27

vk_compute_mipmaps

Customizable compute shader for fast cache-aware mipmap generation
GLSL
37
star
28

gl_vk_raytrace_interop

Adding ray traced ambient occlusion using Vulkan and OpenGL
C++
29
star
29

vk_async_resources

Sample showcasing lifetime management and resource transfers in Vulkan
C++
27
star
30

gl_render_vk_ddisplay

OpenGL sample that renders into a Vulkan direct display
C++
25
star
31

gl_multicast

OpenGL sample for the new GL_NVX_linked_gpu_multicast extension
C++
25
star
32

vk_device_generated_cmds

Vulkan sample on VK_NV_device_generated_commands
C++
24
star
33

vk_timeline_semaphore

Vulkan timeline semaphore + async compute performance sample
GLSL
22
star
34

shared_external

external libraries, needed for the samples (AntTweakBar; ZLib...)
HTML
16
star
35

vk_offline

Rendering offline using Vulkan without opening a window
C++
13
star
36

glsl_indexed_types_generator

GLSL code generator to aid use of Vulkan's descriptor set indexing
Lua
12
star
37

vk_memory_decompression

Vulkan Memory Decompression (VK_NV_memory_decompression) sample
C++
10
star
38

gl_cuda_simple_interop

Sample showing OpenGL and CUDA interop
C++
9
star
39

vk_streamline

DLSS Super Resolution and DLSS Frame Generation via Streamline
C++
9
star
40

vk_idbuffer_rasterization

Vulkan sample to render efficient per-part IDs in CAD models
C++
8
star
41

gl_path_rendering_CMYK

Example of how to use path rendering; and how to use it with CMYK (using multi-render target)
C++
8
star
42

dx12_present_barrier

This sample demonstrates the usage of the new NvAPI interface to synchronize present calls between windows on the same system as well as on distributed systems.
C++
5
star
43

nvml_enterprise_gpu_check

Shows how to check if a GPU is an Enterprise/Quadro GPU using NVML.
C++
4
star
44

vk_raytrace_displacement

C++
3
star
45

third_party_binaries

pre-built libraries for the nvpro-samples framework
C
2
star
46

vk_inherited_viewport

VK_NV_inherited_viewport_scissor and secondary subpass command buffer re-use
C++
2
star
47

gl_vrs

Variable Rate Shading in OpenGL
C++
2
star
48

vk_ddisplay

Sample to demonstrate multi-GPU rendering and presenting to ddisplays, meaning displays that are not part of the Windows desktop and of which an application takes complete control.
C++
1
star