OpenGothic icon indicating copy to clipboard operation
OpenGothic copied to clipboard

Ray Tracing bringup

Open Try opened this issue 3 years ago • 6 comments

This ticket is to track ray-query/ray-tracing work

command line: Gothic2Notr.exe -rt изображение

  • [x] Engine api bring-up
  • [x] Static mesh support
  • [x] Textures support (Vulkan only for now)
  • [ ] Animated meshes

Issues:

  • in DX12 backend shader compiler crashes from time-to-time - need to investigate (https://github.com/microsoft/DirectXShaderCompiler/issues/4394)
  • in Metal spir-v cross generates seemingly invalid code for RQ shader (https://github.com/KhronosGroup/SPIRV-Cross/issues/1910)
  • Vulkan implementation might suffer from dangling-pointers/missing barriers - need to verify with spec and do more testing

Try avatar Apr 08 '22 20:04 Try

First bring up: изображение

RQ is done only for landscape mesh, at deferred lighting pass

Try avatar Apr 08 '22 20:04 Try

Notes: blas/tlas performance is quite inconsistent. Having same landscape geometry at one mesh and as multi-mesh about 4x fps difference:

FPS Method
40.4 multi-mesh land + objects
40 multi-mesh land
200 objects
185 single-mesh land
163 single-mesh land + obj

GPU is RTX 3070

This performance change can be explained by: https://developer.nvidia.com/blog/best-practices-using-nvidia-rtx-ray-tracing/ :

Organizing geometries into BLASes
Consider splitting a BLAS when there is a lot of empty space in an instance’s world-space AABB. World-space AABBs are used to test whether a ray potentially hits an instance and traversing its associated BLAS is required. A significant amount of empty space can lead to unnecessary traversal through the BLAS. Geometries that move independently should usually be in their own BLASes. Merging them into a single BLAS can easily lead to an AABB with lots of empty space, and likely lead to unnecessary rebuilding of the BLAS instead of simply changing transformations of the independent instances.

Still annoying; material indexing is gonna be more difficult

Try avatar Apr 17 '22 12:04 Try

New screenshot: indoor case. изображение

Try avatar May 15 '22 22:05 Try

Bindless turnout to be non-trivial in many ways, works only on Vulkan backend for now, with texture-array capt at 4096 unique textures. More about Bindless problems: https://github.com/Try/Tempest/issues/36 изображение

Try avatar Jun 19 '22 15:06 Try

Снимок экрана 2023-07-03 в 20 22 41

Metal3: 12fps in mac-air... but at least works

Try avatar Jul 03 '23 18:07 Try

Metal3 bindless: изображение

Try avatar Jul 16 '23 17:07 Try