Can a shader be used to detect collisions?

You can write data from shaders into RWStructuredBuffer and extract it. This has been introduced either in DirectX11 or DirectX10. But.

I’m quite certain you will not be able to do that in shadergraph. You’d need either a full code shader or you’d need to use function nodes.

In practice something like this has been used for voxelizing scene in NVida VXGI, for example.

Related:

1 Like