OpenGL Water. github water shader c++.

  1. Render two texture before main render
    • Refraction Texture : everything below water.
    • Relection Texture : everything above water.
  2. Water ripple effect: adding distortion by adding offset to the reflection texture coordinates.
    • Du/Dv Map: texture used to simulate the appearance of waves or ripples on the surface of water. The “Du” and “Dv” represent the changes in texture coordinates (U and V) across the surface of the water.
    • (1) Clamp to avoid glitch; (2) Move factor to add motion.
    • other options : Simple Sinusoidal Waves, Perlin Noise or Simplex Noise, Turbulence Function with scaling.
  3. Fresnel Effect (depending on view direction) to blend the textures.
  4. Specular highlights to the water with normal maps 。
  5. Depth Effects with Depth Texture.