If you are building a game, you likely want it to make it as beautiful as possible. As in all previous moments of video game history, we are still limited by hardware capability. There is a balance between beautiful graphics and good performance. The balance is crucial to making a successful video game. One of the ways to achieve beautiful results is through ray tracing technology.
Does Unity Support Ray Tracing? Yes, Unity does support ray tracing. Developers using the High Definition Rendering Pipeline have access to full capabilities of ray tracing technology.
Let’s look into a few areas you may curious about before making the decision to implement this in your next project.
How Do You Enable Ray Tracing in Unity?
1. Setup Your Project for High Definition Render Pipeline
Make sure you are using the high definition render pipeline (HRDP). If you are unsure what this is, check out this page here. It gives a brief overview of what HDRP is. Below is a video to describe a little bit of a difference between HDRP and URP.
If you choose to use HDRP on a project purely for the graphical benefits, you should keep in mind that it is widely considered to be non-production ready. Unity has made it fairly clear they favor the Universal Render Pipeline for most production projects. I would consider this technology for projects that only demanded it, such as realistic graphic needs and still rendering.
For game projects, I still recommend the Universal Render Pipeline (URP). You want to make your game as accessible as possible. HDRP currently requires relatively high end hardware.
For ray tracing technology, it is recommended that you are running at least a 2080 GTX video card. These are still quite expensive, relatively new, and there is a good chance that the average gamer is running incapable hardware with this technology.
2. Understand A Bit About Post Processing Effects
If you are trying to accomplish high quality rendering in Unity, you won’t get very far without a bit of knowledge in the post processing effects.
My students frequently complain that Unity just doesn’t “have the graphics that Unreal has”. To be quite honest, Unreal probably is slightly more powerful in terms of graphics. However, there is no doubt that you can create absolutely stunning video games in Unity as well. Just take a look at the “Enemies” cinematic trailer that Unity released showing off their capability.
If you are bit lost with post processing in general, I would highly recommend checking out Brackey’s video explaining the image effects that come with Unity’s post processing system. You will quickly realize that the look of your game is highly dependent on your own artistic creative ability, not on the engine itself.
3. Setup Ray Tracing Within Your Post Processing Settings
Within your Post Processing Volume, add the “Screen Space Global Illumination” Override.
Enable all of the settings under the override.
With “Tracing” checked, select “Ray Tracing” from the select menu.
From there, you simply adjust the settings. Keep in mind that the more you increase sample and bounce count and other settings the more resource intensive the lighting system will be on your computer. Your scene is now setup with Real Time Ray Tracing!
If you need a visual walk through, I would highly recommend this video. He walks through some of the settings, hardware requirements, and overall setup of getting ray tracing working in Unity HDRP.
Is Ray Tracing Necessary In Modern Video Games?
Clearly, ray tracing really improves the look of lighting in Unity. It is impressive for realism scenes. However, ray tracing is not necessary. Many successful, beautiful games have and continue to be created without ray tracing technology.
The cost of worrying about the performance and needing to optimize everything just to enable it for gamers is something I would be hesitant to suggest to new game developers. Your first games will not be well optimized. This isn’t an excuse to not focus on optimization, but more than likely it’s not going to be a focus early on.
Your code will be a bit taxing. Your models may have too many polygons. Your UV’s are likely a bit sloppy on models and may require more texture calls than what would be necessary if it was well optimized. For this reason, I would not recommend ray tracing for most games.
You can still build a beautiful game without ray tracing. I would use ray tracing if I were doing still renderings for architecture or other realism scenes. There may be a few cases for animated film or other areas in which I am outputting video.
Do All Modern Video Cards Support Ray Tracing?
The newest graphics cards on the market do support ray tracing technology. Ultimately, you probably need an NVIDIA RTX 2060 or better to really receive the quality you hope.
Some of the older generation graphics cards often seen in laptops or even more affordable gaming PC’s may not support ray tracing technology. Ray tracing is relatively new technology. Be sure to check the type of card you have in your PC if you hope to implement this technology in your project.
Most agree that 2000 series video cards are really not made to fully handle the ray tracing technology. It is capable, but at the cost of performance. If you truly want to see the best performance, you likely need to move to a 3000 series card, such as the 3060 or 3080.
Keep in mind that the 3060 has recently dropped in price and is slightly cheaper than the RTX 2060 at the time of writing this. The 3060 is only slightly better in terms of performance. If you are looking for an upgrade soon, it would likely be worth it go ahead and make the move to the 3000 series.
Conclusion
Ray Tracing is really awesome! It is beautiful, in fact. However, HDRP is not really a production pipeline for video games. In addition, technology is still not quite where it needs to be to utilize ray tracing technology.
I am recommending only using this technology in Unity for still image renderings or video projects. At the same time, I do believe over the next few years, this technology will become more accessible. Hardware will eventually catch up.
For the independent game developers, it may be worth toying around with. I would recommend sticking with the Universal Render Pipeline (URP) for now. Eventually, we will see this become a more viable option for projects. Without a good background in optimization, I would hesitate using ray tracing technology.