GLSL for simple water surface effects

前端 未结 2 438
北海茫月
北海茫月 2020-12-29 10:24

I\'m looking for some pointers on how to implement simple water surface effects in OpenGL ES 2.0. Nothing fancy like reflection or refraction, just a basic ripple/wave eff

相关标签:
2条回答
  • 2020-12-29 10:40

    There is an old trick to simulate water waves & ripples using minimum effort in terms of equations. It's used in many places, and I can't find the original, but you can grab it, for example, from here.

    You'll need 2 textures, each containing just height. Simulation is done by ping-ponging between them (using one as a source and second as destination each time).

    When rendering, you might need to derive surface normal from the neighbour heights.

    0 讨论(0)
  • 2020-12-29 10:49

    Adrian Boeing's blog has example GL code, accompanied by clear explanations, for a number of effects including ripple.

    0 讨论(0)
提交回复
热议问题