Ray casting

Updated: 08/02/2019 by Computer Hope
Diagram: example ray casting scenario.

In CGI (computer-generated imagery), ray casting is the most basic form of raytracing. Unlike other forms of ray tracing, where rays originate from a light source and bounce off objects to arrive at the observer, in ray casting, they're "cast" directly from the viewpoint. When cast rays intersect an object, the object's color and brightness at that point determines the value of one pixel in the final image. A direction vector represents the orientation of the observer extending forward. A "camera plane" perpendicular to the direction vector, representing the shape of the final rendered image, is also required in most types of ray casting.

In computer games

Ray casting is lower-quality than other forms of ray tracing, but significantly faster. For this reason, it was used with early 3D video games.

Screenshot: Wolfenstein 3D, released in 1992.

The first game built on a ray casting engine to achieve massive success was Wolfenstein 3D, which was released on May 5, 1992. The game featured a maze-like map of rooms where the floors, walls, and ceilings were all the same height, making it ideal for ray casting. The game provided an interactive 3D world, displaying it at a higher frame rate and with a more advanced level of photorealism than previous games. Its success dramatically transformed the video game industry.

Modern video games have advanced significantly since Wolfenstein 3D, with faster CPUs, more memory, and the availability of GPUs to accelerate the computation of 3D graphics. However, most modern video game 3D engines still use an advanced form of ray casting, because it remains the most efficient method to render a 3D image.

Frame rate, Game terms, Memory, Software terms