Gamasutra: The Art & Business of Making Gamesspacer
Sponsored Feature: Ocean Fog Using Direct3D 10
View All     RSS
August 29, 2014
arrowPress Releases
August 29, 2014
PR Newswire
View All

If you enjoy reading this site, you might also want to check out these UBM Tech sites:

Sponsored Feature: Ocean Fog Using Direct3D 10

June 11, 2009 Article Start Page 1 of 3 Next

[In this new Intel-sponsored feature from the Visual Computing microsite, a trio of Intel engineers showcase an experiment to create an ocean and complex fog effects using Direct3D 10 and Shader Model 4.0, complete with freely available source code and executable demo.]


The purpose of this project was to investigate how we could effectively render a realistic ocean scene on differing graphics solutions while trying to provide a current working class set of data to the graphics community.

Given the complexities involved with rendering an ocean as well as fog effects we chose to start by using a projected grid concept, because of its realistic qualities, as our baseline.

We then ported the original Direct3D 9 code to Direct3D 10 and also ported the additional effects we needed to convert to Shader Model 4.0. In doing so we took advantage of a great opportunity to learn about an interesting subject (the projected grid) while adding many more nuances to it.

In addition to determining how best to work with this complex system under a DirectX10 scenario, we also wanted to know what would be required to achieve reasonable frame rates on both low- and high-cost graphics solutions.

During this endeavor we learned much about how to offload certain computations to the CPU versus the GPU, as well as when and where those compute cycles would be the most beneficial, both on high-end and low-end graphics solutions. For example, on the CPU front, using the Intel Compiler (version 10.1), we were able to gain an easy 10+ fps on our CPU-side computations (to generate fog and approximate wave movement).

Projected Grid Ocean

The basic concept behind the projected grid ocean is a regular discretized xz-plane that is displayed orthogonally to the viewer in world space. The vertices of this grid are then displaced using a height field. The height field is a product of two variables, which return the height value as specified by the following equation:

This method has proven very useful for generating a virtual large body of water.

The Perlin noise computation for generating the wave motion uses four textures of varying granularity called "octaves" to animate the grid in three dimensions. We chose this method to generate wave noise over other functions, such as Navier-Stokes, because it was less compute intensive on the CPU. The GPU-side Navier-Stokes implementation was not used, but it is worth further investigation. For reflections and refractions the algorithm uses derivations of Snell's function.

To further add realism to the scene we restricted the height of the camera on the y axis so that the illusion of ocean vastness could be maintained.

For a detailed description of this method, refer to Claes Johanson's Master Thesis.1


1 Johanson, Claes. "Real-time water rendering-introducing the projected grid concept." Master of Science thesis in computer graphics, March 2004., (PDF)

Article Start Page 1 of 3 Next

Related Jobs

Retro Studios - Nintendo
Retro Studios - Nintendo — Austin, Texas, United States

Gameplay Engineer
Smilegate West
Smilegate West — Toronto, Ontario, Canada

Java Developer
Trion Worlds
Trion Worlds — Redwood City, California, United States

Senior Gameplay Engineer
Heavy Iron Studios, Inc.
Heavy Iron Studios, Inc. — Los Angeles, California, United States

Game Programming Intern


Jeromie Walters
profile image
Perhaps a video link or screenshot for those of us who would like to see it but still have Windows XP and cannot download the DirectX 10 runtime? Otherwise awesome article, enjoyed the read and just wish I could see it all in action! :)

David Paull
profile image
How can you have a article like this without pictures?

Simon Carless
profile image
We've added some screenshots, thanks - the original white paper this was taken from didn't have any, but Intel dug some up for us.

Jeromie Walters
profile image
Wow, screens look awesome! Thanks for adding the pics!