Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • entries
    62
  • comments
    51
  • views
    10,126

Demystifying Ray Tracing Further

Mira Yurizaki

264 views

With NVIDIA's RTX cards out and the company pushing ray tracing, I figured I have a look around at what I could in the graphics community through blog posts and whatnot about ray tracing itself. Then interacting with the community it seems like there are some misunderstandings and perhaps a warped interpretation of what's going on. So this post is a random assortment of thoughts regarding the encounters of others discussing this topic and what my input is.

 

Ray tracing describes a type of algorithm, but it's not necessary a specific algorithm

The first thing I encountered with looking through literature is that what's called "ray tracing" can be vague. Does it describe a specific algorithm such as heap sorts or fast inverse square or does it describe a class of algorithms like selection sorting or binary search algorithm? Or in another way of thinking, does ray tracing describe something like "storage device" or does it describe something like "NAND-based, SATA solid state drive?"

 

As far as the usage of the term goes, I'm led to believe that ray tracing is describing a type of algorithm. That is, the basic algorithm is shooting some ray out that mimics how a photon is shot out, then tracing it along some path and seeing how it interacts with the world. To that end, I've found several forms of ray tracing that exist:

  • Ray Casting: This is the most basic version of ray tracing, where the first thing the ray intersects is what the final output is based on. One could argue this is the basic step of ray tracing in and of itself.
  • Ray Marching: The most common implementation of this is the ray is the path generated by spheres that originate at some point. At the first point, a sphere grows until it hits something, then the the next point of the ray is at the edge of the sphere in the ray's direction. Then another sphere is generated that grows until it hits something, creates a new point at the edge in the direction of the ray, and so on. An object is considered "hit" when the sphere is small enough.

spheretrace.jpg

(Taken from http://jamie-wong.com/2016/07/15/ray-marching-signed-distance-functions/)

  • Path Tracing: When someone usually talks about ray tracing without any other context, this is the algorithm they're usually referring to. Path tracing attempts to trace the path of the ray from the camera to a light source. On top of this, each sample point use a ray that's pointed in a random direction. The idea is the more samples you use, the closer you get to the actual image.

Some industry folks may consider "ray tracing" itself to be the original algorithm devised by J. Turner Whitted while "path tracing" is the algorithm described by Jim Kajiya.

 

Ray tracing is also solving a problem with rasterizing

What rasterized rendering does today is it dumps a ton of information about the scene before proceeding to work on it. One of the first thing it dumps is all of the geometry the camera view cannot see. Next, pieces of the scene are built up one by one. They either add on top of each other right away like in a forward renderer or the parts of it are assembled on the side to be combined later like in a deferred renderer. (https://gamedevelopment.tutsplus.com/articles/forward-rendering-vs-deferred-rendering--gamedev-12342)

 

One issue with traditional rendering is also the order in which things are rendered. This can lead to weird artifacts like light spilling onto areas where there's no obvious light source, like in these example:

2019041914055800-659B13F48903294AE2B3FA4F12DA9898-2.jpg

 

2019041914055200-659B13F48903294AE2B3FA4F12DA9898-2.jpg

 

By using ray tracing, the rays bring back information of what's visible, what isn't visible, and how light can indirectly affect other objects in a realistic manner.

 

Real-time ray tracing isn't a relatively new thing for games

The funny thing is, ray tracing has been used for some time. Some games, like Guerilla Games' Killzone Shadowfall uses ray tracing to do screen-space lighting (slide 84), mostly in reflections and what appears to be ambient occlusion.



1 Comment


Recommended Comments

Nice intro!

 

These 6 videos below really helped me get a better understanding of RT (certain rendering effects) & full-scene path tracing (rendering all things in all kinds of ways via simulating multiple bounces of light rays).

 

Ray Tracing & Path Tracing explained:

 

The components of software (compute) and hardware accelerated ray tracing ~ aka "hybrid rendering":

 

 

Seeing the difference.........

 

Spoiler

.

.

.

 

An industry professional's blog on all things ray traced: http://raytracey.blogspot.com/

 

Everything you'd ever want to know about current & past developments in rasterized rendering techniques (there's tons more if you search for it):

 

On a side note, it seems like it takes an interval of around 5-8 years between each significant leap in graphics. I would define each "leap" as point or short stretch in time where advances in hardware and software come together just right in terms of performance, the right market circumstances, and affordability to the majority of consumers to result in objectively significant improvement(s) in visual quality.

 

Such intervals spanned between...........

  • When PONG released in 1972 and the "golden days" of 2D games and arcade machines 
  • to the Atari home console days of the mid-80s up to the Sega Genesis in 1988
  • to the Nintendo 64 & PlayStation in 1995/1996 
  • to C&C Generals, Microsoft Flight Simulator X, Crysis, and LoL/Op. Flashpoint: Dragon Rising in 2003, 2006, 2007, and 2009 respectively
  • to CS:GO in 2012, the Xbox One/Crysis 3/Arma III/BF4/Dota 2 in 2013, The Witcher 3 & Dying Light in 2015, and BF1 in 2016

.............to hopefully a generation of AWESOME 75% RT to 100% path-traced mobile, desktop-console, AR, and VR games starting in 2021. Not to mention the proliferation of XR entertainment centers, Intel graphics cards and a new Atari console

 

 

And finally, here's my full run-down of what ray tracing is: https://forum.warthunder.com/index.php?/topic/415043-testing-vulkan17062019-¡el-cliente-vulkan-a-veces-funciona-vulkan-client-sometimes-works/&do=findComment&comment=8278877

 

Enjoy! ^_^

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×