Have you been living under a rock for the past couple of months ?. No ?. Well then, if you are into computers you might have had this word Ray Tracing splashed all over your face from your YouTube feed.
And you may be wandering, what in the name of Computer Gods of yore is it ?
Or maybe you do know what it is and just want to have a little perspective as to what this really means for the gaming scenarios, hardware and graphics in general?.
What can you probably expect in the new gaming card “Novelty” put forth by Nvidia in terms of its RTX series ?.
Or maybe who knows you may have a few minutes to spare and want to read something cool, informative and funny.
If you just answered yes to any of those, hang around I just might make your day.
I also created a YouTube video for the topic, if video is more your thing. Enhance your perception on Ray Tracing with this video served to you with love.
Ray Tracing : Explain Like I Am 5 (ELI5)
Here’s what good ol’ Wiki says.
In computer graphics, ray tracing is a rendering technique for generating an image by tracing the path of light as pixels in an image plane and simulating the effects of its encounters with virtual objects.
Jeez, I sometimes wish Wiki was a little less wiki ya know ?. Anyhoo, If it was, you wouldn’t be reading me now would ya.
You Know What Let Me Rasterize You A Little Bit,
So in order to understand ray tracing in a complete sense you first need to understand how graphic rendering happens today.
Now this is gonna be interesting, stay with me alright, I need your attention here.
The code that goes into making a game, you know the one that is created by game developers ?. Yeah.
So this code directs the GPU to create a frame or scenery as it were that the game wants, in forms of polygons.
You definitely might have seen this somewhere in videos where these weird ass polygons are moving and somehow a graphic is superimposed on them that leaves you wondering, how in the name of blue heavens did that happen.
These polygons represent how the actual frame is “supposed” to look.
Once the polygons are created they are the translated or “Rasterized” on a 2D plane.
After this the shader units comes in and create all those colors, shadows and shines on a pixel by pixel basis.
It is quite similar to an artist painting on a canvas you see.
This in effect creates or paints a frame and depending on your GPU these frames are created a certain number of times in second.
The number of times these frames are created in effect is called FPS or Frames Per Second.
In order to get a smooth gameplay, your graphic processing unit must be able to produce atleast 30 fps.
Ideally, 60 fps is what is considered to be apt if you need to enjoy the bliss that is PC gaming.
So Ray Tracing Han ?, How’s This Different ?.
I have to ask. Did you pay attention in high school ?. Or were you like me ?.
If not get ready for some lessons in physics.
Take the room you are sitting in right now. I am assuming you are sitting in a fairly lit room.
Take a look at a point on any object you find in your room.
I want you to know what is happening this very moment ?.
A light ray from its source of origin, a bulb or the good ol’ sunny is falling on that point and after getting reflected from that point is entering your eye.
This light ray entering your eye is forming an inverted image in your retina and a whole mess of information is travelling from that optic nerve into your brain which is doing its mumbo jumbo and showing you what is infront of you.
Lol, and people think their iPhones are smart.
Look within my child, look within and you will find your iPhone sucks lemons.
— Computer Jesus
Our Sense Of Perception.
So what we need to understand here is unlike our minds light always travels in a straight direction.
And its the backward projection of the light ray falling on an object that enables us to actually see the object.
So what ray tracing is doing is using this fundamental nature of light to produce individual pixels instead of shader acting as an artist.
Do you see why this would be better ?.
Come on, take a moment and think. Use that big brain of yours.
The way our eye see everything the way it is, is because the light ray presents it the way it is.
There is no corruption in how the world is presented to us, you see. Light rays are humble.
Yeah what we create out of what we see in our heads, that’s our problem. As far as nature goes it’s incredibly pure.
Let’s get Technical,
Now that you have had your lesson in Physics.
Let’s now take a look at how everything is happening in application environment.
So we have established that in this new method instead of approximations we are trying to present everything the way it is.
But dude, you didn’t ask me one fundamental question in all of this and that is.
“You are giving us all these boring physics lessons and that’s completely fine, but there isn’t one light ray that is there that you are trying to trace?. There are infinite light rays coming out of every source of light. And not just that those light rays are bouncing off of these objects, and hence creating this plethora of light rays. How in the name of blue hell are you planning on tracing that stuff ?.”
Ray Tracing Requires Huge Compute Capabilities
That’s an incredible question actually.
You know Ray Tracing isn’t actually new, you have already seen it without even knowing it.
Yup, I am talking about some of your favorite movies like Toy story and Monsters university.
But here is the thing those people got them monies yo.
They have these incredible computers that render those images that are created as a result of detailed ray tracing on huge server farms.
And the incredible shiny reflective surface that you see in those movies are a direct consequence of that.
You know what at the end of this post I am going to share some incredible facts about ray tracing that will blow your minds.
I am not sharing them here now because I don’t want to create a distraction for you.
Who know you will run off to somewhere else without understand the whole thing.
And that will make me sad.
I don’t like being sad.
So huge server farms. Yeah. The problem is we don’t have huge server farms.
We ain’t got farmhouses wherein we can store supercomputers and server farms rendering huge frames.
And if we can’t do it on our average consumer grade computers, then this whole post is a big dull dud. Ain’t it ?.
Implementing Ray Tracing In Real Time
Hold on to your horses boys, there is a solution.
What if instead of trying to trace every single photon or wave (depending on what scientists you like) that comes out of every single light source we just trace one.
Wait what ?.
Yeah, how the big heads in technology are actually implementing this tech into real world and real time situations like gaming is instead of tracing all these rays from source to destination, they are simulating a virtual camera that represents the consumers screen and tracing these rays from the camera through the pixel over onto the objects represented by game code to the source.
In order to input added realism, the light ray that is coming from the shadow of a tree if it passes through a bunch of leaves in a tree.
The varying intensity in the light ray can be used to create a varying pattern on the pixel in order to create a very real life like situation.
I am telling you guys, we think we are confused about the world we are living in. People are saying we are living in a simulation.
Wait till these guys remove all the creases from this virtual tech. I am telling you the boundaries between reality and illusions are getting thinner by the day.
There might be a day, where we might stop wondering and pondering over that question and have no confusions.
That will be a scary day.
Ah, I don’t mean to scare you guys. I am just screwing with ya.
Or Am I ???????
So where were we ?.
Ah yeah, so was I able to provide you with some kind of clarity into Ray Tracing.
Please understand this post is about giving you an awareness as to how the thing is operating and how is it different from what do we have now.
I hope you have this awareness that things get quite tricky when all of these things are happening simultaneously at software and at hardware level.
That Interview Though
Watch this video to perceive ray tracing holistically and not trying to learn what it is.
Because I have already taught you what it is. 😛
If you look at what Tom is inferring here is the current situation in terms of where ray tracing actually is is at its nascent stage. Or the toddler stage really.
He used terms such as de-noising and adjacent pixel simulation. These techniques create pixels via approximations and calculations coming from traced pixels. Though these calculations are far better than the traditional rasterization that we have right now but still it is not what we want it to be.
What he is really saying is if you perceived it correctly, that with the new RTX series is the first step to evolution of enhanced graphics via ray tracing.
The extent to which ray tracing can be implemented right now is limited by hardware capabilities and computational costs involved.
Not to mention the game developers who have yet to incorporate codes that make use of ray tracing.
Does that mean this is the extent of ray tracing we will have. Abso-freakin-lutely not.
As hardware capabilities increase and computational costs come down,we are looking at some really really good illusions in the future to play with.
The Good, Bad & The Ugly
Please understand why this technique is inherently better than rasterization.
No approximations. You understand ?.
There is no artist that is creating an image as per data received from polygons.
Therefore, everything is presenting itself the way it is and thus the images/frames we receive as a consequence really kick some ass.
I am talking incredible shadows.
Incredible shines of that lamp post on a shiny car. Shadows of firing bullets on the ground. Shadows of the sparks that come out of a gun on another gun :P.
The other thing is accuracy.
Here is the thing and I am quoting Tom here. If you have the right models, parameters and algorithms in place that know how light works.
Every dimension gets modeled in the most accurate way possible.
Ray tracing as of now at least the way it is being implemented on the graphic cards is as I pointed out earlier is an amalgamation of exactness and approximations.
Techniques such as de-noising and adjacent pixel simulation are indication towards fact that real time ray tracing now and for some time to come will be a hybrid of exactness and added simulations.
Present Extent Of Ray Tracing Implementations
The ugly side is as we have discussed over the course of this post is the way we want ray tracing demands a lot of work on the hardware, software and the game engine’s side.
The real ugly side is as of now for consumer grade applications and gamers especially is, not many games and apps support ray tracing.
As of right now I know Battlefield V supports it.
Here’s to hoping that newer titles start supporting this feature soon.
Who wants to live in the pain of overpaying for a feature that we may not use for a long time ?.
Yeah, I said very ugly didn’t I ?.
Hmm, let’s see is there anything else I should tell you before I head off for lunch. I feel like going chinese today.
Oh yeah, I promised some interesting facts about ray tracing. Here you go.
- The Verge On Ray Tracing and Nvidia
- How Pixar Deployed Ray Tracing
- 1084 days and Toy Story
- 29 Hours to render a single frame
I really hope you enjoy these miscellaneous reads I just pulled out for ya.
If there is something you think I might have missed out on the article, or you need any kind of clarifications on anything we discussed here or you want to add something that you know and I in my limited knowledge doesn’t, It would mean the world to me if you comment about the same below.
With that I am off to lunch and you know what maybe a little power nap after that.
I will see you again very , very soon 🙂
Namaskaram _/\_ 🙂