16

As far as I know, all the techniques mentioned in the title are rendering algorithms that seem quite similar. All ray based techniques seem to revolve about casting rays through each pixel of an image which are supposed to represent rays of real light. This allows to render very realistic images.

As a matter of fact I am making a simple program that renders such images myself based on Raytracing in one Weekend.

Now the thing is that I wanted to somehow name this program. I used the term “ray tracer” as this is the one used in the book.

I have heard a lot of different terms however and I would be interested to know what exactly is the difference between ray tracing, ray matching, ray casting, path tracing and potentially any other common ray-related algorithms. I was able to find some comparisons of these techniques online, but they all compared only two of these and some definitions overlapped, so I wanted to ask this question about all four techniques.

BDL
  • 21,052
  • 22
  • 49
  • 55
janekb04
  • 4,304
  • 2
  • 20
  • 51
  • 2
    Well, the question isn't about a piece of code, but due to it being about rendering it is strongly related to programming and, as such, could prove useful to the users of the website. – janekb04 May 01 '21 at 20:45
  • 3
    @BDL may be its just me but how is clarification on difference between very similar **rendering algorithms** not related to programming ? its not even a request for any tutorial or docs ... – Spektre May 02 '21 at 08:29

1 Answers1

15

My understanding of this is:

  1. ray cast

    is using raster image to hold the scene and usually stop on first hit (no reflections and ray splitting) and does not necessarily cast ray on per pixel basis (usually per row or column of screen). The 3D version of this is called Voxel space ray cast however the map is not voxel space instead 2 raster images RGB,Height are used.

    For more info see:

  2. (back) ray trace

    This usually follows physical properties of light so ray split in reflected and refracted and we stop usually after some number of hits. The scene is represented either with BR meshes or with Analytical equations or both.

    for more info see:

    the back means we cast the rays from camera to scene (on per pixel basis) instead of from light source to everywhere ... to speed up the process a lot at the cost of wrong lighting (but that can be remedied with additional methods on top of this)...

The other therms I am not so sure as I do not use those techniques (at least knowingly):

  1. path tracing

    is optimization technique to avoid recursive ray split in ray trace using Monte Carlo (stochastic) approach. So it really does not split the ray but chose randomly between the 2 options (similarly how photons behave in real world) and more rendered frames are then blended together.

  2. ray marching

    is optimization technique to speed up ray trace by using SDF (signed distance function) to determine safe advance along the ray so it does not hit anything. But it is confined only to analytical scene.

Spektre
  • 49,595
  • 11
  • 110
  • 380
  • Ray marching doesn’t necessarily speed up ray tracing with the SDF. In fact just to render a simple triangle it requires a quite complicated function that’s called multiple times per pixel. It’s much better suited to objects that don’t have a good ray intercept function, handling reflections, warping space or repeating spaces. A good example of an object better suited for ray marching is the Menger sponge, making use of many repeating reflections – Dalton Mar 24 '22 at 16:36
  • The algorithm to speed up volumetric rendering of (signed) distance scenes is called "sphere tracing". Ray marching may refer to whole the class of algorithms which sample the volume at multiple points along the ray, but is also commonly used as a name for equidistant sampling when comparing against other more specialized methods. – pbsds Jan 24 '23 at 10:52