When Sony introduced the PlayStation 3 back in 2005 during an E3 keynote, the demonstration had a few staples. Space marines, explosions with dancing debris—the usual. However, one of the most memorable tech demos wasn't centered on any kind of violence at all, but something much more impressive: a rubber ducky.
"Here's my duck, stunningly rendered in real time," said Phil Harrison, then-executive vice president of Sony Computer Entertainment Europe. "We have the ability to render the water in great detail. As I jump the duck in and out you can see all the caustics and effects that are being rendered in real time on this fantastic HD display."
As Harrison spoke, the duck scooted about a tub, leaving behind a tiny trail of precious shockwaves, water splashing against the sides whenever the duck drifted by. Harrison then filled the tub with more ducks until it looks like a tiled bag of popcorn, but the audience really started to holler when two glass cups started pouring water back and forth.
When video games want to dazzle you, they don't use dragons or giant bugs, because fantastical creatures don't need to prove themselves. Rather, realism is the spectacle—our oceans, rivers, puddles and swimming pools shimmering in real time. Water comes up so often in graphical discussion it's practically cliché.
It's probably no coincidence then that Nintendo's splashy jet ski series Wave Race 64 came out only a month after the Nintendo 64 launched, and it's sequel Blue Storm on the same day as the GameCube. It's also not surprising that Crytek's first gaes, Far Cry and Crysis, took place on tropical islands with bright blue beaches.
Water is the unlikely element that games have always used as a measure of performance because it's so hard to get it right.
"Often we use fluids in tech demos because it is so computationally demanding. But the result is something beautiful that anyone can appreciate," said Miles Macklin, a physics programmer who works at the graphics technology company NVIDIA on the PhysX team.
"One reason we find fluids so captivating is that they show detail and complexity at a wide range of length scales. For example, large vortices will dissipate into smaller vortices, and eventually turbulence; larger bodies of water will split into many smaller droplets, etc. Capturing these effects is difficult, but when it is done well we find it particularly visually pleasing," Macklin explained.
It's not as if we don't appreciate other forces of nature and their graphical nuances. The drifts of snow in Killzone 3 or the sand dunes of Journey are stunning, but neither are as heralded or as often used—plus water covers about 71 percent of the world, so it's no surprised it's so often used.
Uncharted even had a rendering engine dedicated specifically to the wet stuff—one that developers Naughty Dog took great pride in. "Our water shader not only uses the same basic reflection and refraction techniques as other games, but uniquely models water flow effectively," wrote Neil Druckmann and Richard Lemarchand in a post mortem for Gamasutra. "Color is computed not from textures but by using optical and physical principles, some based on water depth, which helps give our water a very realistic look. We did all of our water effects -- foam, water bubbles from churn, and silt -- in the shader, which also helped our water "sell." All in all, we were very happy that we not only caught up in terms of graphics technologies, but even helped raise the bar."
Indeed, when Uncharted came out, it felt as if its flooding chambers, misty waterfalls and the damp shirt of lead character Nathan Drake were the most discussed parts of one of the PlayStation's biggest blockbusters.
Even with today's processing power, making water isn't as easy as turning on the tap. Those in the industry know that water is a frustrating material to program. It bubbles and splashes, it fills whatever it's poured in until it spills over. It rains, it soaks, and it has volume—which according to Macklin is one of the most troublesome qualities of all.
"The major challenge for water in games is performance," said Macklin. "Good algorithms are well known for simulating water, but they are often too slow for real-time applications. Often the major computational cost is in maintaining fluid incompressibility—that is, the requirement that the fluid does not change its volume. This is a fundamental property of water. Depending on the technique used, if incompressibility is not maintained then you may notice mass loss, which appears as water unnaturally evaporating into thin air."
It's hard to say how much longer the race for realistic waves will continue. The goal for games in general now no longer seems to be photorealism, but rather, other kinds of ways to cause your jaw to drop—gameplay, originality, atmosphere. In fact, when trailers and tech demos come out nowadays, the reactions usually aren't stunned as much as skeptical. Hydrophobia tried to sell itself on its water rendering merits, but the gameplay itself was a wash.
In fact, Macklin's says the most memorable water effects for him aren't the crashing waves of Assassin's Creed IV: Black Flag or Far Cry's tropical blue shores, but the heavily stylized waves of The Legend of Zelda: Wind Waker. The 2002 Nintendo GameCube game was cel-shaded and cartoony, sure, but it used inspired visual cues to convey a feeling of movement along the open seas.
Realistic water, on the other hand, will likely always be difficult to render in real time. And just like the uncanny awkwardness of virtual faces, we tend to notice when water is off—even just a little.
This story is part of The Building Blocks of Everything, a series of science and technology stories on the theme of materials. Check out more here: http://motherboard.tv/building-blocks-of-everything