Patent ID: 8368688

Claim:
A fluid rendering method, comprising: providing state information of a plurality of fluid particles, wherein the state information records whether the fluid particles are located above or under a fluid surface and the interactions between the fluid particles and a terrain or a plurality of dynamic objects, and the step of providing the state information of the fluid particles comprises: rendering a height field of the terrain and the dynamic objects in the region of the fluid particles; calculating a gradient value at each position in the terrain and the dynamic objects by using the height field and serving the gradient value as the flow direction of the fluid particles along the terrain or the dynamic objects, and recording the gradient values as a gradient field; adding a predetermined velocity field to the gradient field to obtain a flow field of the fluid particles; and determining a state transition situation when the fluid particles interact with the terrain or the dynamic objects by using a finite state machine according to state information of the fluid particles and the information of the height field and the flow field, and recording the state transition situation as the state information of the fluid particles; determining whether to render the fluid particles in a direction facing a viewer or in a direction parallel to the flow direction according to the information that whether the fluid particles are located above or under the fluid surface; and rendering the fluid particles as a plurality of two-dimensional metaballs according to the interactions between the fluid particles and the terrain or the dynamic objects and stacking the metaballs to reconstruct the fluid.