+in vec3 aNorm;
+in vec3 aCo;
+in vec3 aWorldCo;
+
+#include "common_world.glsl"
+
+vec4 water_surf( vec3 halfview, vec3 vnorm, float depthvalue,
+ vec4 beneath, vec4 above )
+{
+ vec3 colour_shore = vec3( 0.21, 0.6, 0.8 );
+ vec3 colour_ocean = vec3( 0.01, 0.1, 0.2 );
+ vec3 surface_tint = mix(colour_shore, colour_ocean, depthvalue);
+
+ float ffresnel = pow(1.0-dot( vnorm, halfview ),5.0);
+
+ vec3 lightdir = vec3(0.95,0.0,-0.3);
+ vec3 specdir = reflect( -lightdir, vnorm );
+ float spec = pow(max(dot(halfview,specdir),0.0),20.0)*0.3;
+
+ // Depth
+ float depthblend = pow( beneath.a,0.8 );
+
+ // Composite
+ vec3 vsurface = mix(surface_tint, above.rgb, ffresnel );
+ //vsurface += spec;
+
+ return vec4( vsurface,depthblend );
+}