Volume ray casting, sometimes called volumetric ray casting, volumetric ray tracing, or volume ray marching, is an
image-based volume rendering technique. It computes 2D images from 3D volumetric data sets (3D
scalar field
In mathematics and physics, a scalar field is a function associating a single number to every point in a space – possibly physical space. The scalar may either be a pure mathematical number ( dimensionless) or a scalar physical quantit ...
s). Volume ray casting, which processes volume data, must not be mistaken with
ray casting in the sense used in
ray tracing, which processes surface data. In the volumetric variant, the computation doesn't stop at the surface but "pushes through" the object, sampling the object along the ray. Unlike ray tracing, volume ray casting does not spawn secondary rays.
When the context/application is clear, some authors simply call it ''ray casting''.
Because ray marching does not necessarily require an exact solution to ray intersection and collisions, it is suitable for
real time computing for many applications for which ray tracing is unsuitable.
Classification
The technique of volume ray casting can be derived directly from the
rendering equation
In computer graphics, the rendering equation is an integral equation in which the equilibrium radiance leaving a point is given as the sum of emitted plus reflected radiance under a geometric optics approximation. It was simultaneously introduc ...
. It provides results of very high quality rendering. Volume ray casting is classified as an image-based volume rendering technique, as the computation emanates from the output image and not the input volume data, as is the case with object-based techniques.
Basic algorithm
In its basic form, the volume ray casting algorithm comprises four steps:
# Ray casting. For each pixel of the final image, a ray of sight is shot ("cast") through the volume. At this stage it is useful to consider the volume being touched and enclosed within a ''
bounding primitive
In computer graphics and computational geometry, a bounding volume for a set of objects is a closed volume that completely contains the union of the objects in the set. Bounding volumes are used to improve the efficiency of geometrical operatio ...
'', a simple geometric object — usually a
cuboid
In geometry, a cuboid is a hexahedron, a six-faced solid. Its faces are quadrilaterals. Cuboid means "like a cube", in the sense that by adjusting the length of the edges or the angles between edges and faces a cuboid can be transformed into a cu ...
— that is used to intersect the ray of sight and the volume.
# Sampling. Along the part of the ray of sight that lies within the volume, equidistant ''sampling points'' or ''samples'' are selected. In general, the volume is not aligned with the ray of sight, and sampling points will usually be located in between
voxel
In 3D computer graphics, a voxel represents a value on a regular grid in three-dimensional space. As with pixels in a 2D bitmap, voxels themselves do not typically have their position (i.e. coordinates) explicitly encoded with their values. ...
s. Because of that, it is necessary to
interpolate the values of the samples from its surrounding voxels (commonly using
trilinear interpolation).
# Shading. For each sampling point, a transfer function retrieves an
RGBA material colour and a
gradient
In vector calculus, the gradient of a scalar-valued differentiable function of several variables is the vector field (or vector-valued function) \nabla f whose value at a point p is the "direction and rate of fastest increase". If the gr ...
of illumination values is computed. The gradient represents the orientation of local surfaces within the volume. The samples are then ''shaded'' (i.e. coloured and lit) according to their surface orientation and the location of the light source in the scene.
# Compositing. After all sampling points have been shaded, they are ''
composited'' along the ray of sight, resulting in the final colour value for the pixel that is currently being processed. The composition is derived directly from the
rendering equation
In computer graphics, the rendering equation is an integral equation in which the equilibrium radiance leaving a point is given as the sum of emitted plus reflected radiance under a geometric optics approximation. It was simultaneously introduc ...
and is similar to blending acetate sheets on an overhead projector. It may work ''back-to-front'', i.e. computation starts with the sample farthest from the viewer and ends with the one nearest to the viewer. This work flow direction ensures that masked parts of the volume do not affect the resulting pixel. The front-to-back order could be more computationally efficient since, the residual ray energy is getting down while ray travels away from camera; so, the contribution to the rendering integral is diminishing therefore more aggressive speed/quality compromise may be applied (increasing of distances between samples along ray is one of such speed/quality trade-offs).
Advanced adaptive algorithms
The adaptive sampling strategy dramatically reduces the rendering time for high-quality rendering – the higher quality and/or size of data-set, the more significant advantage over the regular/even sampling strategy.
However, adaptive ray casting upon a projection plane and adaptive sampling along each individual ray do not map well to the
SIMD
Single instruction, multiple data (SIMD) is a type of parallel processing in Flynn's taxonomy. SIMD can be internal (part of the hardware design) and it can be directly accessible through an instruction set architecture (ISA), but it should ...
architecture of modern GPU. Multi-core CPUs, however, are a perfect fit for this technique, making them suitable for interactive ultra-high quality
volumetric rendering
In scientific visualization and computer graphics, volume rendering is a set of techniques used to display a 2D projection of a 3D discretely sampled data set, typically a 3D scalar field.
A typical 3D data set is a group of 2D slice ima ...
.
Examples of high quality volumetric ray casting
This gallery represents a collection of images rendered using high quality volume ray casting. Commonly the crisp appearance of volume ray casting images distinguishes them from output of
texture mapping
Texture mapping is a method for mapping a texture on a computer-generated graphic. Texture here can be high frequency detail, surface texture, or color.
History
The original technique was pioneered by Edwin Catmull in 1974.
Texture mappi ...
VR due to higher accuracy of volume ray casting renderings.
Image:Croc.5.3.10.a_gb1.jpg
Image:Croc.5.3.10.b_gb1.jpg
Image:Croc.5.3.10.h_gb1.jpg
Image:High Definition Volume Rendering.JPG
The CT scan of the crocodile mummy has resolution 3000×512×512 (16bit), the skull data-set has resolution 512×512×750 (16bit).
Ray marching
The term ray marching is more broad and refers to methods in which simulated
rays are traversed iteratively, effectively dividing each ray into smaller ray segments, sampling some function at each step. These methods are often used in cases where creating explicit geometry, such as triangles, is not a good option.

Other examples of ray marching
* In SDF ray marching, or sphere tracing, 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. This method is often used for 3D fractal rendering.
* 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
In geometry, a normal is an object such as a line, ray, or vector that is perpendicular to a given object. For example, the normal line to a plane curve at a given point is the (infinite) line perpendicular to the tangent line to the curve ...
data is stored per each 2D pixel.
See also
*
Amira Amira, Ameerah, or Ameera may refer to:
Arts and entertainment
* ''Amira'' (album), by Amira Willighagen, 2014
* ''Amira'' (film), a 2021 Jordanian film
People
* Amira (name), an Arabic and Hebrew female given name
* Amira (singer), American si ...
– commercial 3D visualization and analysis software (for life sciences and biomedical) that uses a ray-casting volume rendering engine (based on
Open Inventor)
*
Avizo – commercial 3D visualization and analysis software that uses a ray-casting volume rendering engine (also based on Open Inventor)
*
Shadertoy - online community and platform for Computer graphics professionals, academics and enthusiasts who share, learn and experiment with rendering techniques and procedural art through
GLSL code
*
Volumetric path tracing
References
External links
Acceleration Techniques for GPU-based Volume Rendering (J. Krüger, R. Westermann, IEEE Visualization 2003)A single-pass GPU ray casting framework for interactive out-of-core rendering of massive volumetric datasets (E. Gobbetti, F. Marton, J.A. Iglesias Guitian, The Visual Computer 2008)
{{DEFAULTSORT:Volume Ray Casting
3D imaging