Check out the most common approaches used to create surface, mirror, and water reflections in games.
Have you ever thought about how mirrors and reflections are made in games? Games these days include a handful of reflecting surfaces, whether it’s a glass wall, windows, skyscrapers, a river, or streets after the rain. We decided to dive into this fascinating game feature, and the White Noise team helped us give you accurate information on existing approaches to create reflections, production process, pros and cons, and technical requirements.
1. Planar Reflections. If you use the planar reflections approach, you will use the additional render for the whole scene. In this case, level designers create only one room and add a virtual camera for the reflection which will go as a mirror. This approach suits wells if you work with reflections for simple and plain rooms with fewer details, high-detailed scenes are too complicated for planar reflections.
2. Cubemaps from NVIDIA. In 1999, NVIDIA had presented the most powerful GPU for that time and also introduced Cube Maps which were used in PS1 in racing games to simulate reflections on the car. The technology is quite old but still relevant to this day. With cubemaps, you take 6 planes and put them on the cube’s facets. After this step, you have to blur its surfaces so players won’t see the cube. This method works best for reflecting surfaces, not for mirrors or dynamic objects.
You can also work with shaders and combine them with old technologies to achieve desired effects. In UE4, for example, you can create reflections using the material editor that doesn’t require coding.
3. Screen Space Reflections or SSR. First of all, let’s focus on the technical solution. SS captures not only reflections; for example, and SSAO (Screen Space Ambient Occlusion) is still a very common technique. The process goes this way: for rendering, it takes information from the G-buffer or Z-Buffer render frame. These buffers are the stages of frame rendering; the Z-buffer of depth is used for AO and, for reflections, it uses G-buffer. As a result, the technology goes very cheap for resources since it basically uses what has already been rendered.
However, there are some limitations to this approach. A hypothetical mirror cannot reflect what does not see the frame of the game camera, for example, what is behind the back or on the sides of the player. As a result, we see artifacts only. The technology is mostly used for realistic reflection in puddles and other well-reflecting surfaces of the floor. We don’t recommend you using this technology as an independent one, it works best with cubemaps.
4. Ray-Tracing and Reflections. Ray-Tracing recreates the light source, not the light effect only. This way, the reflections are made as realistic as possible. For example, when working on the TwinSoul game, White Noise launched it on Geforce 1070 cards. This approach works only with next-gen consoles since the process is still resourceful.
In terms of quality and realism, ray-tracing technology is definitely the best way to create believable reflections in games. Hopefully, in the future, this tech won’t cost that much, and with the release of next-gen consoles, there will be fewer issues with technical requirements for such games.
Don’t forget to read the interview with the White Noise team on its survival horror Twin Soul game.