You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1.8 KiB
1.8 KiB
SDFRT
Implicit surface rendering via ray tracing
Introduction
采用Ray Tracing(其实本质上是Ray Marching)解决隐式曲面的渲染问题,Backend为Vulkan,引入Nvidia的NVVK
来简化各种资源的申请和初始化,输出可视实时渲染结果。目前仅支持硬编码隐式函数的渲染
Dependencies
- cmake >= 3.15
- VulkanSDK >= 1.3
- Nvpro_cores
Project
implicit_surface_ray_tracing
:主项目,输出带GUI的隐式曲面实时渲染程序,支持输出渲染结果为HDR、PNG、BMP格式Sphere_Tracing_CPU_Test
:在CPU上对Sphere Tracing
的测试和同Adaptive Marching Points
的对比(因为调试Compute Shader
过于困难)
Build
经测试在Win10 + MSVC下构建顺利,按照Nvpro_cores
库的说明应该在Linux下也能正常构建,但没有测试
构建完成后需要install
来移动资源,从而实现Spirv
格式的Shader Module的加载
Performance
以下测试中步进步数和其余项目是分开测试的,因为测试步进步数需要Atomic Operation
,对实时性能影响较大
实际上用
glslc
对Shader做了控制,只有在Debug
构建时才会测试步进步数
在1024*1024
分辨率、同屏渲染200*200*50
个周期的TPMS时:
Adaptive Marching Points | Sphere Tracing | |
---|---|---|
frame time (ms) | 12+ | 0.6 ~ 0.7 |
fraps per second | 80+ | around 1400 |
rendering time per pixel (ns) | <= 11.5 | around 0.48 |
ray steps per pixel (approx.) | 8 ~ 10 | 1.5 ~ 2.5 |
ray steps range (approx.) | 10 ~ 400 | 0 ~ 240 |
目前来说,即便是使用
Sphere Tracing
也只能在保持微小结构可辩别的10倍基础分辨率(10240*10240
)下达到30fps左右,建议实时渲染时以基础分辨率预览即可,需要输出高分辨率图像时再调高分辨率输出
Screenshot
Known issues
- 目前
Release
模式构建出来无法正常渲染,推测是目前暴力将Output image直接Blit到Swapchain Framebuffer上的操作水土不服 - 现在
Adaptive Step Size Relaxation
渲染模式还在施工,估计会比Sphere Tracing
还要快一些