Guest Blogs are written by third-party developers with real-world expertise creating virtual reality experiences. They are a great way to dive into the thoughts and opinions of folks on the bleeding edge of VR design and software engineering.
Today’s blog is about the use of color in virtual reality – a subject we chose because developing and color usage in virtual reality is worlds different than for a traditional PC or console game.
There are many well-known techniques for lighting and coloring games that have been mastered over the past few decades, but what happens when game designers begin working in newly immersive environments? What happens when everything you knew about color and design for traditional games doesn’t work they way that it used to? Starting from scratch can be daunting but exploring the unknown and the potential of what these experiences can mean in new VR platforms is too exciting to pass up.
In this article we hope to paint a picture of the challenges we’ve encountered developing Anshar Wars 2, as well as the steps we’ve taken to make our visuals pop in VR.
Environments
We found that bright, colorful environments are very eye-catching and dramatically enhance the VR experience. For Anshar Wars 2, we opted for a high contrast and bright color style that is halfway between realistic and cartoonish. This decision later proved to be handy because it allowed us to add comic style elements to the game without breaking immersion. We use a variety of hot and cold colors with bright and dark intensity variations across the levels.
For example, some missions take place in space while others take place on planets. Our team chose to differentiate these radically different environments through colors and intensities.
Anshar Wars 2 uses OpenGL ES 2.0 but we compressed the textures in ETC 2 for maximum visual fidelity. While the cost of using ETC 2 increases scene loading times compared to ETC 1, we found that scenes could be instantaneously reloaded for replay (for example when the player has died), which is the most critical scenario.
The skyboxes of Anshar Wars 2 are multilayered. The base is painted with bright colors. On it we add a layer of stars that twinkle themselves using the mipmaps of the skybox textures. The darker it is the more the stars twinkle. When rendering a small, distant planet to a skybox it is painted directly to the base layer.
However, if the planet is very close and therefore appears much larger, as in Mission 13, an additional step is necessary. We instantiate the planet model in Unity and then, through a system of omnidirectional camera captures, render shots of the skybox with the large planet integrated. Finally the basic skybox is replaced with the one that contains the planet.
The 3D models that make up the environment are illuminated by a minimum of two static directional lights: a backlight and a front light. Added to this is a slight rim and a fog effect as shown here in the screenshot.
Fog and dynamic lighting of environments
Fog is a widely used element in Anshar Wars 2 for multiple reasons. It allows for a smooth transition between the ground and a skybox and it also gives a sense of depth and immensity. Sometimes the fog is treated in complex ways and the light changes direction depending on the orientation of the camera.For example, in Mission 6, the skybox is bicolor so that fog and rim shading on asteroids changes color depending on the player view. The fog and rim effects have an additional benefit: they help to clearly distinguish the shape of obstacles, even in dark environments.
In Mission 6 we also used some point lights to highlightimportant features of the mission. The fireball makes a yellow reflection on the models around it and both Nergal Recon ships make a red reflection. Both of these point light additions help to provide a better grasp of the environment and its immediate obstacles to avoid.
Planets
It’s absolutely thrilling to fly over planets in VR, getting super close to the ground to feel a sense of great speed! We absolutely had to integrate this feeling into Anshar Wars 2. But building ground environments turned out to be more complicated than we had anticipated. Low poly modeling (to meet mobile performance requirements) with textures that are not too flat nor too repetitive, nor too memory intensive required a lot of time and energy from our team.
We used several methods to texture the surface of the ground. Here are two of the techniques that were used in Anshar Wars
2:
- For Mission 3, which takes place in a snowy environment, we
have a low poly ground on which we applied a detailed texture which
includes pre-baked
- For Mission 10, which is a pursuit mission in a canyon, we used a
technique of layer mask shaders with up to three tiled
textures.
Anshar & Nergal Identities
The geometric shape representing the Anshar faction (the good guys) is the hexagon, which is a shape we think of as quite round and friendly, while the Nergal faction (the bad guys) is represented by an inverted triangle, a more aggressive shape. While enemies can easily be identified with “classic” colors (red, black and purple), allies wear golden yellow, turquoise and white.
We try to remind players of those identities as often as possible in the form of the models in the interface so the player can easily identify enemies or allies throughout the game.
Anshar Identity
Nergal Identity
The red and black for enemies is effective, but it wasn’t easily identifiable in an outer space environment. Over a dark star field background, the mostly black Nergal ships were not distinct enough. To overcome this we created outlines on textures that highlight the overall visual characteristics of each ship.
These outlines, illuminated by a sun for a natural effect through a custom shader, are displayed when the spacecraft is far away, and then gradually fade out when they are closer to the player.
Text display in VR
Text in VR is not a simple matter. First, there is the chromatic aberration when the GUI or texts are moved away from the center. The text should also be kept as close to the center of the screen as possible.
Moreover, fine and very contrasted lines of text tend to vibrate a lot at current VR display densities. To prevent vibration we used bold fonts and focused on using text boxes with a background (even a light, transparent color) to soften the contrast between the font and the game background. We found that using variable colors and light intensities in these text boxes, while keeping contrast with the background, meant that our players were able to read every piece of text in every situation.
VR offers a new opportunity to work with light and color in video games and our studio is thrilled to have found ways to make our vision come to life so beautifully in Anshar Wars 2. It is still the early days of VR, and we look forward to seeing how the next generation of VR game developers will find new ways to make these experiences thrive.