{"id":19817143,"url":"https://github.com/nvpro-samples/vk_raytrace_displacement","last_synced_at":"2025-05-01T11:30:23.093Z","repository":{"id":212572857,"uuid":"728405677","full_name":"nvpro-samples/vk_raytrace_displacement","owner":"nvpro-samples","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-28T10:32:17.000Z","size":158,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-10-28T13:52:09.828Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nvpro-samples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.txt","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":"2023-12-06T21:50:53.000Z","updated_at":"2024-10-28T10:32:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"4f0ae12c-d062-4a37-8f01-d1716ddcb551","html_url":"https://github.com/nvpro-samples/vk_raytrace_displacement","commit_stats":null,"previous_names":["nvpro-samples/vk_raytrace_displacement"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvpro-samples%2Fvk_raytrace_displacement","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvpro-samples%2Fvk_raytrace_displacement/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvpro-samples%2Fvk_raytrace_displacement/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvpro-samples%2Fvk_raytrace_displacement/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nvpro-samples","download_url":"https://codeload.github.com/nvpro-samples/vk_raytrace_displacement/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224253431,"owners_count":17280934,"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":[],"created_at":"2024-11-12T10:11:47.919Z","updated_at":"2025-05-01T11:30:23.087Z","avatar_url":"https://github.com/nvpro-samples.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DEPRECATED\n\nThe **NVIDIA RTX Mega Geometry** technology supercedes displaced Micro-Meshes. This repository is archived as result.\n\nPlease have a look at this new sample [vk_tessellated_clusters](https://github.com/nvpro-samples/vk_tessellated_clusters) that showcases real-time adaptive tessellation with displacement for ray tracing and rasterization.\n\n# vk_raytrace_displacement\n\n![](doc/preview.jpg)\n\nThis sample demonstrates the use of the\n[`heightmap_rtx`](https://github.com/NVIDIAGameWorks/heightmap_rtx) library to\nraytrace dynamically displaced geometry. `heightmap_rtx` is a small Vulkan\nlibrary to displace raytraced triangles with a heightmap. It uses [NVIDIA\nMicro-Mesh](https://developer.nvidia.com/rtx/ray-tracing/micro-mesh)\n([Toolkit](https://github.com/NVIDIAGameWorks/Displacement-MicroMap-Toolkit))\ninternally.\n\nA notable feature of this sample is animation. A single and static\n`VkCommandBuffer` that `heightmap_rtx` populates is resubmitted each frame\nbefore building the acceleration structure. This allows convenient animation\nwithout any mid-frame resource allocation for building the Micro-Map.\n\n## Requirements\n\n[`heightmap_rtx`](https://github.com/NVIDIAGameWorks/heightmap_rtx) is a\nsubmodule. Run `git submodule update --init --recursive`.\n\nAlong with other nvpro samples, `nvpro_core` and the `VulkanSDK` are required to\nbuild this project. Cmake will look in the parent directory for nvpro_core and\nthe VulkanSDK is typically found via environment variables.\n\n[VK_NV_displacement_micromap](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_NV_displacement_micromap.html)\nis required. See [device\nsupport](https://vulkan.gpuinfo.org/listdevicescoverage.php?extension=VK_NV_displacement_micromap\u0026platform=all).\n\n\u003e [!IMPORTANT]\n\u003e `VK_NV_displacement_micromap` likely requires recent NVIDIA [vulkan beta\n\u003e drivers](https://developer.nvidia.com/vulkan-driver) (\u003e= 537.96) and\n\u003e [VulkanSDK](https://vulkan.lunarg.com/) (\u003e= 1.3.268.0), particularly for GLSL\n\u003e `NV_displacement_micromap` support.\n\n## Motivation\n\nTo render displacement with rasterization, one might use a tessellation shader,\nmesh shader or trace the heightmap in a frament shader with parallax mapping. In\nconstrast, the vulkan raytracing API would normally only take regular triangle\ngeometry. A base mesh would need to be tessellated and displaced before building\nthe acceleration structure. This limitation is noted by [^1], in which heightmap\ndisplacement traced directly using min-max mipmap acceleration similarly to [^2]\nand [^3]. An alternative to tessellating geometry is NVIDIA Micro-Mesh. This GPU\nfeature offers a way to apply displacement without tessellating in the\napplication code. The vulkan raytracing acceleration structure build step is\nalso faster when using Micro-Mesh. However, building the Micro-Map that holds\nthe displacement is not trivial to code. The `heightmap_rtx` library simplifies\nthat step, taking just a `VkImage` displacement image and converting it before\nthe acceleration structure build.\n\n## Limitations\n\nThere are a number of limitations of `heightmap_rtx` when used for displacement.\nPlease see the README in its repository for details. A significant one with\nregard to correctness is that direction vectors are not normalized after\ninterpolation. This means displacement near high base mesh curvature will\nproduce quite different results.\n\n[^1]: Theo Thonat, Francois Beaune, Xin Sun, Nathan Carr, and Tamy Boubekeur.\n    2021. Tessellation-free displacement mapping for ray tracing. ACM Trans.\n    Graph. 40, 6, Article 282 (December 2021)\u003cbr/\u003e\n[^2]: Kyoungsu Oh, Hyunwoo Ki, and Cheol-Hi Lee. 2006. Pyramidal displacement\n    mapping: a GPU based artifacts-free ray tracing through an image pyramid. In\n    Proceedings of the ACM symposium on Virtual reality software and technology\n    (VRST '06)\u003cbr/\u003e\n[^3]: Art Tevs, Ivo Ihrke, and Hans-Peter Seidel. 2008. Maximum mipmaps for\n    fast, accurate, and scalable dynamic height field rendering. In Proceedings\n    of the 2008 symposium on Interactive 3D graphics and games (I3D '08)\u003cbr/\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvpro-samples%2Fvk_raytrace_displacement","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnvpro-samples%2Fvk_raytrace_displacement","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvpro-samples%2Fvk_raytrace_displacement/lists"}