A New & Unique Approach to Creating Mirrors for Games in Unity

According to the developer, the novel method is faster than ray tracing and more detailed than Screen Space Reflections.

Throughout the entire history of the video game development industry, undoubtedly, one of the most captivating subjects has been the creation of in-game mirrors. Reflections, typically taken for granted in real life, present one of the most challenging phenomena to faithfully reproduce in the digital realm, forcing many developers to compromise and remove mirrors from their games entirely to ensure playability.

Despite these hurdles, various methods have emerged over the years, including Planar Reflections, Cube Maps, and, notably, Screen Space Reflections (SSR) and ray tracing, with game developers employing these techniques to incorporate reflections into their projects. Recently, it appears that the list of possible ways to set up in-game reflections has been extended, all thanks to Game Developer known as MacksNotCool.

In a recent demo shared on Reddit, the creator showcased an early version of their approach, dubbed McLaurin's Sphere-Space Path Tracing (MSSPT). This method, which operates within the Unity Universal Render Pipeline (URP), works similarly to SSR, but instead of relying on the camera view, MSSPT renders two Cube Maps – one for storing color information and another for position information.

This position information is then used to calculate intersections and appropriately color the reflections, resulting in a faster alternative to ray tracing that offers more detailed reflections than Screen Space Reflections by accessing information beyond the camera view.

"[MSSPT] is meant to be an in-between of screen space and ray tracing," commented the developer. "It's significantly faster than ray tracing and it lacks the issue with Screen Space Reflections not being able to render outside of the viewport."

"My method renders the reflection at the correct distance (which requires tracing). This allows for extremely fast near-perfect reflections. Cube Maps lack the parallax. If I were to have done this with a Cube Map that doesn't update every frame, it'd appear to be at a lower resolution and there would be a significant amount of extra artifacts."

The creator further noted that the method is still in its infancy and will be further refined and enhanced with Global Illumination and Ambient Occlusion in the final version. We highly encourage you to follow MacksNotCool on Reddit so as not to miss any future updates.

And here are some insightful tutorials on setting up reflections in Unity:

Don't forget to join our 80 Level Talent platform and our Telegram channel, follow us on InstagramTwitter, and LinkedIn, where we share breakdowns, the latest news, awesome artworks, and more.

Join discussion

Comments 0

    You might also like

    We need your consent

    We use cookies on this website to make your browsing experience better. By using the site you agree to our use of cookies.Learn more