[In a 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.
Intel engineers Jeff Andrews, Chuck Desylva, and Alfredo Gimenez recently investigated how one could effectively render a realistic ocean and fog on different graphics solutions. What they found, among other things, was how to offload certain computations to the CPU instead of the GPU, and where those compute cycles would be the most beneficial on low- and high-end graphics solutions. The engineers wrote:
"For the Perlin fog we decided to implement the processing on the CPU. To do this, we sampled points in the 3D texture space, separated by a stride associated with each octave-the longer the stride, the more heavily weighted the octave was in the total texture.
Each of these sample points was mapped to a pseudo randomly chosen gradient, using a permutation table full of normalized gradients from a given point and a hash function. The value of each pixel was then determined by the weight contributions of its surrounding gradient samples. All of these separate octaves were then summed to achieve a result that has smoothed organic noise on both a near and far perspective.
This result was successful; however, we wanted to achieve an even more smoothed effect and have only subtle noise visible. We then applied a simple Gaussian blur algorithm (also during preprocessing)."
The trio also said that low-cost graphics solutions have come a long way:
"The top two areas of performance improvement that impacted the low-cost graphics target were in the Perlin fog and the ocean grid computations. The latter renders only in the camera's view frustum and was easy to control given the original algorithm.
Through that we could easily reduce mesh complexity and in doing so reduce the scene overhead. We also gained even more performance on both integrated and discrete graphics by combining terrain and building meshes.
We came close to doubling our frame rates by pre-computing the Perlin textures on the CPU and using the GPU only for blending and animating the texture. Additional performance gains were also made by tuning down the ocean grid complexity and using only the necessary reflection and refraction computations."
For the full technical article from Andrews, Desylva and Gimenz, read today's sponsored feature
on Gamasutra (no registration required, please feel free to link to this feature from other websites).