Fix fog calculation in water shader.
Merge remote-tracking branch 'upstream/master'
fix memory crash, other tools needs fix also.