The water flow achieved by the shader (WebGL)

This time has been watching shader How to draw a flow of water, directly map (FIG height, normal maps) implemented method, are not discussed here.

Bobo found a large customer information, feel the presence of the following questions :

1⃣️ most of the information is based on opengl achieve (or unity in the shader), too much focus on the render mesh to achieve the above rather than waves, people no desire to read on

2⃣️ some are directly copy someone else's blog, the formula to move large chunks, but no trace of their opinions, too perfunctory

3⃣️ the code without comment, to come to the learner not very friendly

4⃣️ for the realization webgl, online little information (even with the realization of opengl would have been sufficient, but since reaching the party too)

So after access to the information, I decided to write a version of webgl realization (three.js + shader)

wave nvidia official implementation equation (in fact, most online blog in the equation should all be from here): Portal .

-------------------------------------------------- ----------------- gorgeous dividing line ----------------------------- --------------------------------------------

一、PlaneGeometry + ShaderMaterial

 

Guess you like

Origin www.cnblogs.com/eco-just/p/11747777.html