6 ms·
They explicitly say in the article that it does not involve ray racing, of which ray marching is a subset.
by hellofunk 6y ago
They explicitly say in the article that it does not involve ray racing, of which ray marching is a subset.
- klodolph 6y agoIt's possible that "it does not require ray tracing" means that it does not require extensions like RTX. Perhaps it uses voxel cone tracing, which you may say is technically not ray tracing, but if you called it ray tracing you wouldn't exactly be wrong either.
- Rusky 6y agoThe article contrasts this approach with voxel cone tracing, so it's not that either.
- dcanelhas 6y agoI would call it Sphere Tracing since that's what it's called in "Hart, John, C; Sphere Tracing: A Geometric Method for the Antialiased Ray Tracing of Implicit Surfaces; The Visual Computer-1995"
- gh123man 6y agoThis was my interpretation. If you want to get technical, Ray tracing != path tracing != ray marching. However people often use them interchangeably.
- Jasper_ 6y agoIt ray-marches the SDF when integrating them into the probes. You can see that here: https://github.com/godotengine/godot/blob/481151be09108a30002ae0a9df118eeddd3987be/servers/rendering/rasterizer_rd/shaders/sdfgi_integrate.glsl#L211-L233 https://github.com/godotengine/godot/blob/481151be09108a3000...
- dahart 6y agoWhile they are related, and the terms are somewhat overloaded and depend on context, I wouldn't call SDF ray marching (aka SDF sphere tracing) a subset of ray tracing, at least not according to today's common usage of those terms. Unless you are using 'ray tracing' to mean the family of techniques that do anything with a ray (which is not the most common interpretation, IMO), then there are things each technique can do that the other cannot. Ray tracing most commonly refers to solving ray-surface intersections directly, and/or checking visibility strictly between two points in space, one or both of which may be infinitely far away. SDF ray marching to a surface is iterative and doesn't normally solve ray-surface equations directly, nor does it generally give you a surface normal. Ray tracing, in contrast doesn't allow for neat tricks like single-sample soft shadows, because it doesn't give you any other information about the scene except what's along the ray. While I wouldn't insist on it, I think you could even argue that it's the other way around, ray tracing could be seen as a subset of ray marching, because it's possible to build a ray tracing query out of ray marching, but not possible to build a ray marching query using ray tracing, for example, the kind of basic ray marching you find on ShaderToy can tell you by how much you almost hit a surface, but vanilla ray tracing can't.
- bryal 6y agoDo you know how this ray marching compares to normal ray tracing time complexity wise, with regards to the amount of geometry?
- dahart 6y agoOh, that's a super good, but very difficult question to answer in general. SDF ray marching is quite commonly used in the demo scene and on ShaderToy without an acceleration structure (or "BVH" - Bounding Volume Hierarchy), while ray tracing usually has one. It's common for SDF ray marching scenes to have a very limited number of procedural hand-coded primitives, while ray tracing usually has a lot of simple primitives like triangles and spheres that come out of some modeling tool. The Godot engine, however, has a BVH, so their SDF complexity will depend on that. In it's inner loop, SDF ray marching does a point query against the BVH, while ray tracing does a line query. Both will end up traversing along the line (ray) through the BVH. I'd guess that, attempting to compare apples to apples, ray marching has a slightly higher complexity in practice than ray tracing since it takes multiple iterations to reach a surface, where ray tracing (usually) gets there in one step. But there are multiple factors that can offset this complexity difference, because there are some amazing tricks you can play with ray marching to reduce the number of rays, and because ray marching often better utilizes a GPU.
- bryal 6y ago> SDF ray marching does a point query against the BVH Aah, alright. I've written a ray tracer that uses an (L)BVH before, so I'm familiar with how it works for ray tracing. What I couldn't figure out was how you'd use an acceleration structure for ray marching. Now that you spelled it out though, I suddenly think I get exactly how it would work. > ... ray marching has a slightly higher complexity in practice than ray tracing since it takes multiple iterations ... Great reply, thanks! It made a lot of sense. > ... there are some amazing tricks you can play with ray marching to reduce the number of rays, and because ray marching often better utilizes a GPU. Interesting. Now I'm gettin quite interested in exploring ray marching more.