Search Unity

Why use compute shaders for ray marching/tracing?

Discussion in 'Shaders' started by Rs, Aug 24, 2019.

  1. Rs

    Rs

    Joined:
    Aug 14, 2012
    Posts:
    34
    A good example is this Ray Tracing tutorial from gamasutra. I implemented some ray marching recently but without using any kernels. I simply do all the operations in the shader. My question is: isn't the shader already intrinsecally parallelized by the GPU as it's computing everything in the fragment function?
    Why would I gain anything (and how much would I gain) using a compute shader instead of a simpler fragment shader?
    Thanks