← Back to results

Ray marching - Wikipedia Jump to content Main menu Main

menu move to sidebar hide Navigation Main page Contents Current events Random article About Wikipedia Contact us Contribute Help Learn to edit Community portal Recent changes Upload file Special pages Search Search Appearance Donate Create account Log in Personal tools Donate Create account Log in Contents move to sidebar hide (Top) 1 Distance-aided ray marching Toggle Distance-aided ray marching subsection 1.1 Sphere tracing 1.2 Cube-assisted 2 Volumetric ray marching 3 Deferred shading 4 References Toggle the table of contents Ray marching 1 language Français Edit links Article Talk English Read Edit View history Tools Tools move to sidebar hide Actions Read Edit View history General What links here Related changes Upload file Permanent link Page information Cite this page Get shortened URL Print/export Download as PDF Printable version In other projects Wikidata item Appearance move to sidebar hide From Wikipedia, the free encyclopedia 3D computer graphics rendering method Ray marching is a class of rendering methods for 3D computer graphics where rays are traversed iteratively, effectively dividing each ray into smaller ray segments, sampling some function at each step. For example, in volume ray casting the function would access data points from a 3D scan. In Sphere tracing, the function estimates a distance to step next. Ray marching is also used in physics simulations as an alternative to ray tracing where analytic solutions of the trajectories of light or sound waves are solved. Ray marching for computer graphics often takes advantage of SDFs to determine a maximum safe step-size, while this is less common in physics simulations a similar adaptive step method can be achieved using adaptive Runge-Kutta methods. The technique dates back to at least the 1980s; the 1989 paper "Hypertexture" [ 1 ] by Ken Perlin contains an early example of a ray marching method. Distance-aided ray marching [ edit ] Sphere tracing [ edit ] Visualization of sphere tracing (ray marching using a signed distance function ) In sphere tracing , [ 2 ] or sphere-assisted ray marching an intersection point is approximated between the ray and a surface defined by a signed distance function (SDF). The SDF is evaluated for each iteration in order to be able take as large steps as possible without missing any part of the surface. A threshold is used to cancel further iteration when a point has reached that is close enough to the surface. As powerful GPU hardware became more widely available, this method was popularized by the demoscene and Inigo Quilez, [ citation needed ] co-creator of Shadertoy . For simple scenes with basic 3D shapes, ray marching does not have many benefits over ray tracing (which finds intersections without marching through the space). Strengths of SDF ray marching are, for example, when morphing shapes, approximating soft shadows, repetition of geometry, and algorithmically defined scenes. Signed distance functions exist for many primitive 3D shapes. [ 3 ] They can be combined using mathematical operations like modulo and booleans to form more complex surfaces. For instance, taking the modulus of an SDF's input coordinates tiles its volume across all of space, and taking the maximum of two SDFs gives their volumes' surface of intersection. Because SDFs can be defined for many fractals, sphere tracing is often used for 3D fractal rendering. [ 4 ] Cube-assisted [ edit ] A similar technique to sphere-assisted ray marching, the use of cubes and taxicab distance can be used to render voxel volumes. Volumetric ray marching [ edit ] Main article: Volume ray casting In volumetric ray marching, each ray is traced so that color and/or density can be sampled along the ray and then be combined into a final pixel color. This is often used for example when rendering clouds or 3D medical scans. Deferred shading [ edit ] When rendering screen space effects , such as screen space reflection (SSR) and screen space shadows, rays are traced using G-buffers , where depth and surface normal data is stored per each 2D pixel. References [ edit ] ^ Perlin, Ken (July 1989), "Hypertexture" (PDF) , Computer Graphics , 23 (3): 253– 262, doi : 10.1145/74334.74359 ^ Hart, John C. (June 1995), "Sphere Tracing: A Geometric Method for the Antialiased Ray Tracing of Implicit Surfaces" (PDF) , The Visual Computer ^ Quilez, Inigo. "3D distance functions" . Inigo Quilez . Retrieved 2022-07-08 . ^ Hart, John C.; Sandin, Daniel J.; Kauffman, Louis H. (July 1989), "Ray Tracing Deterministic 3-D Fractals" (PDF) , Computer Graphics , 23 (3): 289– 296, doi : 10.1145/74334.74363 v t e Computer graphics Vector graphics Diffusion curve Pixel 2D graphics Alpha compositing Layers Text-to-image 2.5D Isometric graphics Mode 7 Parallax scrolling Ray casting Skybox 3D graphics 3D projection 3D rendering ( Image-based Spectral Unbiased ) Aliasing Anisotropic filtering Cel shading Fluid animation Lighting Global illumination Hidden-surface determination Polygon mesh ( Triangle mesh ) Shading Deferred Surface triangulation Wire-frame model Concepts Affine transformation Back-face culling Clipping Collision detection Planar projection Reflection Rendering Beam tracing Cone tracing Checkerboard rendering Ray tracing Path tracing Ray casting Scanline rendering Rotation Scaling Shadow mapping Shadow volume Shear matrix Shader Texel Translation Volume rendering Voxel Graphics software 3D computer graphics software animation modeling rendering Raster graphics editors Vector graphics editors Algorithms List of computer graphics algorithms Retrieved from " https://en.wikipedia.org/w/index.php?title=Ray_marching&oldid=1282631894 " Categories : 3D imaging Computer graphics algorithms Hidden categories: Articles with short description Short description matches Wikidata All articles with unsourced statements Articles with unsourced statements from June 2024 This page was last edited on 27 March 2025, at 16:56  (UTC) . Text is available under the Creative Commons Attribution-ShareAlike 4.0 License ; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy . Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc. , a non-profit organization. Privacy policy About Wikipedia Disclaimers Contact Wikipedia Legal & safety contacts Code of Conduct Developers Statistics Cookie statement Mobile view Search Search Toggle the table of contents Ray marching 1 language Add topic