Unknown Worlds Entertainment had a surprise hit with Subnautica, a game focused on ocean exploration. Now they're literally delving deeper into the sea, retrofitting their game with more realistic underwater graphics rendering.

The game was a departure for UWE. Following the release of the multiplayer shooter Natural Selection 2, the small studio wanted to do something different. NS2 was a competitive game with a fairly hardcore "traditional" audience, says UWE technical director Max McGuire, and the team wanted to pursue a game concept with a broader appeal that might attract players outside the traditional games demographics.

The team focused on the themes of exploration and discovery in a beautiful game world. The result is an exploration-based scuba-diving game set on a lush alien planet. The game has been in Steam Early Access since it launched at the end of 2014, but the promise of undersea adventures has already attracted a large audience. (Over 375K owners, according to data gathered from Steam profile pages by the site Steamspy.)

Subnautica recently released a substantial update dubbed Subnautica H2.0, a graphical overhaul with the main goal of giving the player more of an impression of being underwater.

"Starting from above the water surface, we updated the sky visuals and tried to give it a more alien planet feel," McGuire said. "A large portion of the way water looks is the reflections, so we had to do a lot of tuning there. We also gave the waves an overhaul using Jerry Tessendorf's model for ocean."

Of course, the most major tweaks were made to the game world underwater. Lighting plays the biggest role in making the sense of underwater-ness feel realistic. One thing McGuire did was update it so that light from the sun in the sky attenuated as you go deeper into the ocean, as well as improve the model of light scattering in the water.

"One of the big changes was using volumetric data for all of the water and lighting parameters so that they could vary over the world as well as on the screen," McGuire said. "In previous releases these were often constant over the screen, so they faded using timed transitions as you moved between different areas of the game world."

This let UWE remove the outside ambient lighting in deeper recesses of underwater caves, leading to nice spatial transitions between clear water in the shallows and the deep greens of algae-filled kelp waters.

Another big thing McGuire added was more realistic caustic effects for the way light reflects and refracts through the water surface down to below. To make things more realistic, the caustic effects are based on the actual water surface conditions and light shafts that follow that model.

"The main challenge is that in the real world, it's actually pretty hard to see underwater," McGuire said. "There's a strong blue cast, and the sunlight doesn't penetrate very deep. My first iteration of our updated systems was along those lines, and the artists and designers were (rightfully) not especially happy with that."

Think about any professional underwater photograph you've ever seen—maybe of a shipwreck or a coral reef. Everything is clear and well-lit, with a full spectrum of color in view. This is because professional photos use red filters on the camera, strobe lights, and other equipment to make photos look vibrant and interesting, whereas amateur underwater photography is drenched in blue, due to the lack of light underwater.

"But when you're diving, you actually perceive it much more like the pro images," McGuire said. So our goal was to match the professional photo experience more than the physically correct one."

To do this, initially McGuire tried to simulate some of those professional image techniques—red filter, strobe, and so on. But this ended up being a lot of work both in development and runtime, so he opted for a more direct approach: removing the blue cast on the world near the player. He ended up decoupling the rate at which the sun was attenuated by the water from the rate that light reflected off objects was attenuated as it reaches your eye.

In other words, McGuire tried to make the model as realistic as possible within the constraints of a real-time game, and then gave control over all of the various parameters to the level designers to tweak and achieve the desired look.

Before and after: The improved ocean imagery of Subnautica's H.20 update

"In the end, giving control to the level designers over as much as we could was really helpful," McGuire said. "I was initially reluctant because I felt that keeping things physically consistent would yield better results, but it turns out being 150 meters down in the ocean isn't especially interesting."

This is a good start, but McGuire says there's still a lot of work to be done to get Subnautica feeling just right. Light sources under the water, such as bioluminescence and man-made lighting, is something he didn't get quite where he wanted for this patch. Currently different lighting sources just layer on top of each other, in terms of how they are attenuated and perceived by the player. Getting that aspect perfected will certainly play a large role in the final product, as the need for bioluminescence and such increases with depth.

"Glowing creatures and plants under the water are so great for giving the feel of being in an alien place," McGuire said. "There's really nothing more alien on Earth than the ocean."