More low-level GPU tools


I might be off-base with this, but I’ve been reading this presentation and I’d love to attempt to implement something for my own game, however stuff like their raymarching and whatnot are rather difficult to do without digging deep into the thick layer of RHI within the engine source. Is there any chance that at some point in time we get some more “raw” GPU tools exposed to the engine proper so stuff like that is easier to do?

Edit: 666th post, Hell yeah!

I read their paper a few weeks ago. Raymarching can be done with custom nodes, and while I haven’t tried that paper’s final optimization, I suspect it can be done with 16 CanvasRenderTarget2Ds. The major hurdle I ran into was lack of Texture3D support. I made a tiled 3D Worley noise generating material, and rendered 256 slices of that in a 16x16 grid in a 4k CanvasRenderTarget2D. Unfortunately, it takes 7 extra instructions per sample, to translate the world position of a marching ray into uv coordinates of this texture, compared to accessing a Texture3D. Also, it’s mipmapped in 2D so it has some nasty looking artifacts which take many extra instructions to smooth out. So I’d like to see a 3D render target, or at least the ability to import textures as Texture3Ds.

I’ve hit a few snags trying to get anything to render via ray marching in the past, but then again this was some time ago, I might have missed something back then. Would you mind sharing any source you might have?

Sure. Check this post and this post.

For a little speedup I found since posting those, I found it’s faster to march the ray with lerp(StartPos, EndPos, LoopIndex/NumberOfSteps). Also, FastGradientPerlinNoise3D_TEX() looks much better raymarched than it does on a surface. I think it’s currently the best option since we can’t use Texture3D.