Skip to content

nvpro-samples/vk_raytrace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

  • Ray Tracing Pipeline: RayGen, Closest-Hit, Miss, Any-Hit model
  • Ray Query: Compute shader using Ray Queries

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