OpenGL Water. github water shader c++.
- Render two texture before main render
- Refraction Texture : everything below water.
- Relection Texture : everything above water.
- 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.
- Fresnel Effect (depending on view direction) to blend the textures.
- Specular highlights to the water with normal maps 。
- Depth Effects with Depth Texture.