Technology
Fact-checked

At EasyTechJunkie, we're committed to delivering accurate, trustworthy information. Our expert-authored content is rigorously fact-checked and sourced from credible authorities. Discover how we uphold the highest standards in providing you with reliable knowledge.

Learn more...

What is Ray Casting?

Malcolm Tatum
Malcolm Tatum
Malcolm Tatum
Malcolm Tatum

Ray casting is a process that is helpful in identifying and solving a wide range of problems associated with graphics. Sometimes confused with the process of ray tracing, ray casting does perform some of the same functions and usually is able to move with greater speed than current raytracing protocols. The development of the first ray casting algorithm is usually traced back to 1968 and the work of Arthur Appel.

Somewhat more focused in scope than ray tracing, ray casting makes it possible to take 3D images and render them effectively to two-dimensional screens. This is accomplished by tracking the rays of light that trace a direct path from the eye to some source of light. However, ray casting discounts the influence of any element that may intersect that path between the eye and the light source, although the effect of these elements at the point of termination does come into play. Typical influences would be refraction, reflection and shadowing.

Man holding computer
Man holding computer

One of the easiest ways to understand how ray casting works is to think of light emitting from the eye and continuing on in a straight line until being blocked by some object. A portion of the light will stop or be absorbed by the object. Another portion of the light may be reflected by the object in several different directions. Any remaining portion is refracted by the object. Ray casting seeks to identify what percentage of the ray or light is devoted to each of these three possibilities, so that the ray or light is fully accounted for.

The newer technology of ray casting had an impact on the world of animation in very short order. Because of how this process constructs images, ray casting made it possible to design animation for movies and television shows that were of a depth and detail not easily accomplished by other methods. By the middle of the 1980’s, ray casting had become a common tool in many animation studios.

Along with the impact on movies and television, ray casting also aided in the evolution of video games. While the first attempts were somewhat primitive in the late 1970’s and early 1980’s, ray casting helped to add crisp and compelling graphics and 3D images to video games in the 1990’s. These high-resolution entertainment options continue to inform and inspire new video game designs as well as enhance the ability to use animation in movie and television productions.

Malcolm Tatum
Malcolm Tatum

After many years in the teleconferencing industry, Michael decided to embrace his passion for trivia, research, and writing by becoming a full-time freelance writer. Since then, he has contributed articles to a variety of print and online publications, including EasyTechJunkie, and his work has also appeared in poetry collections, devotional anthologies, and several newspapers. Malcolm’s other interests include collecting vinyl records, minor league baseball, and cycling.

Learn more...
Malcolm Tatum
Malcolm Tatum

After many years in the teleconferencing industry, Michael decided to embrace his passion for trivia, research, and writing by becoming a full-time freelance writer. Since then, he has contributed articles to a variety of print and online publications, including EasyTechJunkie, and his work has also appeared in poetry collections, devotional anthologies, and several newspapers. Malcolm’s other interests include collecting vinyl records, minor league baseball, and cycling.

Learn more...

Discussion Comments

David09

@Charred - Of course this kind of thing is not limited to game development. It’s used to recreate physical structures within virtual space as well.

For example, I saw this archaeology program on television where scientists discovered this rare skull whose structure they wanted to investigate further. Rather than remove the skull from the scene, they had one of their computer graphics artists use volume raycasting to send rays through the skull at every direction, inside and out, producing a photorealistic 3D model that was the exact dimensions of the actual skull.

From this virtual model they were able to create a plaster-based reproduction and work with that. That’s pretty amazing when you think about it.

Charred

@nony - Yeah, I remember that in the early days of the computer revolution-when computer graphics was still fairly new-the bulletin boards would have these animations of raycasting that would demonstrate things like fractal geometry and photorealistic 3D texture scenes like mapped terrains.

Some of the results were breathtaking to behold, and depending on the speed of the computer, the rendering of the scene could take minutes or even hours. Of course nowadays those things look simplistic in hindsight, but they were pretty big back then.

The concepts are still in use, of course, it’s just that there are a ton of libraries out there with raycasting algorithms, so you don’t have to write your own.

nony

When I took courses in computer graphics I learned about raycasting as a method used in computer game development. I began using it in my own computer games, using some freely available algorithms on the Internet and also creating some of my own.

Basically you use ray cast procedures so that you can plot where points, lines and even planes intersect on a screen. The purpose of calculating the intersections is so that you can build what are called collision detection routines for your games.

If you’re building an Asteroids game, for example, you need to show the computer how to determine if the spaceship has hit an asteroid. Collision detection will answer that.

Post your comments
Login:
Forgot password?
Register:
    • Man holding computer
      Man holding computer