1

I am developing a game for android with opengl2 es i i want a effect like this: https://lh6.ggpht.com/RF0R32tKjDhQcjNTtW51xd-giuXp-FlsDJaqscilDetI7cMpNQwUDjCryT2qyyBzT6PZ

I supposse that the light is done with normal mapping(am i right?)

but I suposse to that there is some type of distorsion on the behing texture, to simulate de waves.

Which math function could I use to simulate the noise that appears in the image?

thanks

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
seipey
  • 549
  • 2
  • 6
  • 14
  • 2
    Possible duplicate of: [this thread](http://stackoverflow.com/questions/5012905/glsl-for-simple-water-surface-effects)... also, there are many examples if you [Google it](https://www.google.ca/search?q=opengl+simulate+water+waves). – Cat Jun 23 '12 at 23:08

1 Answers1

1

Yes, use a normal map. To make the effect more convincing use multiple normal maps (two or three) that translate in different directions at different speeds. Use Google to find some normal maps that simulate water.

You don't need a mathematical function to simulate the distortion. The refractive and reflective distortion is computed very simply from the normal maps.

Below PowerVR's description and implementation of a water effect. http://www.imgtec.com/powervr/insider/docs/POWERVR.Shader%20Based%20Water%20Effects.1.0.14.OGLES2External.pdf

Below is an NVIDIA article about achieving refraction. This is geared towards DirectX, but the high level explanation is very good. Read the section about water. http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter19.html

user8709
  • 1,342
  • 13
  • 31
  • 1
    URL about POWERVR Shaders doesn't work. I was able to find that pdf on the github: https://github.com/anonymousjustice/pvr-pi/blob/master/SDKPackage_OGLES2/Documentation/POWERVR.Shader%20Based%20Water%20Effects.1.0.14.OGLES2External.pdf – Prizoff Jan 29 '14 at 16:02