Chapter 1. Effective Water Simulation from Physical Models

https://developer.nvidia.com/gpugems/gpugems/part-i-natural-effects/chapter-1-effective-water-simulation-physical-models

this chapter describes a system for simulating and rendering large boides of water on the GPU.
the system combines geometric undulations 波动 of a base mesh with generation of a dynamic normal map. the system has proven suitable for realtime game scenarios, having been used extensively in Cyan Worlds’ Uru: Ages Beyond Myst, as shown in Figure 1-1.
https://www.gameres.com/853093.html
在这里插入图片描述

1.1 goals and scope
real-time rendering techniques have been migrating from the offline-rendering world over the last few years. fast fourier transform (FFT) techniques, as outlined in Tessendorf 2001, produce incredible realism for sufficiently large sampling grids, and moderate-size grids may be processed in real time on consumer-level PCs.
voxel-based 体素 solutions to simplified forms of the Navier-Stokes equations are also viable (Yann 2003).
although we have not yet reached the point of cutting-edge, offline fluid simulations, as in Enright et al.2002, the gap is closing. 差距在缩小。
by the time this chapter is published, FFT libraries will likely be avaiable for vertex and pixel shaders. but as of this writing, even real-time versions of these techniques are limited to implemetation on the CPU.

at the same time, water simulation models simple enough to run on the GPU have been evolving upward as well.
Isidoro et al. 2002 describes summing four sine waves in a vertex shader to compute surface height and orientation.
Laeuchli 2002 presents a shader calculating surface height using three Gerstner waves.

we starting with summing simple sine functions, then progress to slightly more complicated functions, as appropriate.
we also extend the technique into the realm 领域 of pixel shaders, using a sum of periodic wave funtions to create a dynamic tiling bump map to capture the finer details of the water surface.

this chapter focuses on explaining the physical significance of the system parameters, showing that approximating a water surface with a sum of sine waves is not as often presented. we pay special attention to the math that takes us from the underlying model to the actual implementation. the math is key to extending the implementation.

this system is designed for bodies of water ranging from a small pond to the ocean as viewed from a cove or island.
although not a rigorous physical simulation, it does deliever convincing, flexible, and dynamic rendering of water. because the simulation runs entirely on the GPU, it entails 需要 no struggle over CPU usage with either artificial intelligence (AI) or physics processes. because the system parameters do have a physical basis, they are easier to script than if they were found by trial and error. 因为系统参数确实有一个物理基础,它们比通过反复试验发现更容易编写脚本。making the system as a whole dynamic——in addition to tis component waves——adds an extra level of life.

1.2 the sum of sines approximation
we run two surface simulations:
one for the geometric undulation of the surface mesh, and
one for the ripples in the normal map on that mesh.
both simulations are essentially the same.
the height of the water surface is represented by the sum of simple periodic waves.
we start with summing sine functions and move to more interesting wave shapes as we go.

the sum of sines gives a continuous function describing the height and surface orientation of the water at all points.
in processing vertices, we sample that function

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值