Jump to content
  • Advertisement
Sign in to follow this  
Coluna

DX12 RayTracing + Displacement/Tesselation

Recommended Posts

Quick question: does anyone know if directx RayTracing works with tesselation/displacement shaders? If yes, how does it interacts with the TLAS and BLAS? Just for curiosity sake 😃

Share this post


Link to post
Share on other sites
Advertisement

DXR doesn't "work with" those types of shaders, but what it does support is refitting and rebuilding of the BLAS that contains the geometry you want to ray trace. If you want to use tessellation to re-tessellate a mesh/model on a continual basis then you'll need to stream the geometry out to a buffer and issue a refit or rebuild of the BLAS before issuing the DispatchRays call later in the frame.

You can bind a UAV to any shader stage to output a post-tessellated index buffer and vertex buffer, insert a barrier and then issue the rebuild/refit. I haven't seen any sample code on how to do this, but I imagine you'll want to output from the Geometry Shader stage or use Stream Output (the former sounds preferable).

Share this post


Link to post
Share on other sites
3 hours ago, Adam Miles said:

DXR doesn't "work with" those types of shaders, but what it does support is refitting and rebuilding of the BLAS that contains the geometry you want to ray trace. If you want to use tessellation to re-tessellate a mesh/model on a continual basis then you'll need to stream the geometry out to a buffer and issue a refit or rebuild of the BLAS before issuing the DispatchRays call later in the frame.

You can bind a UAV to any shader stage to output a post-tessellated index buffer and vertex buffer, insert a barrier and then issue the rebuild/refit. I haven't seen any sample code on how to do this, but I imagine you'll want to output from the Geometry Shader stage or use Stream Output (the former sounds preferable).

Thus I'm thinking a good solution for shadowing might be constraining tesselation amplitude and using screenspace shadowing/heightfield self shadowing. Precision issues can already be encountered with other raytracing effects,and be overcome with screenspace gap filling already, so this just seems like on more to add to the list.

Besides, tesselation already has texture stretching problems.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!