 
 vec3 GetSurfaceNormal()
 {
-	vec2 position = vfPosition;
-	vec3 heightU = MakeWater3DPos(position + vec2(0, 1.0 / (heightMapSize.y * 0.5)));
-	vec3 heightL = MakeWater3DPos(position - vec2(1.0 / (heightMapSize.x * 0.5), 0));
-	vec3 height = MakeWater3DPos(position);
+	vec3 heightU = MakeWater3DPos(vfPosition + vec2(0, 1.0 / (heightMapSize.y * 0.5)));
+	vec3 heightL = MakeWater3DPos(vfPosition - vec2(1.0 / (heightMapSize.x * 0.5), 0));
+	vec3 height = MakeWater3DPos(vfPosition);
 	vec3 normalFromHeightMap = cross(heightU - height, heightL - height);
 
 	return normalize(normalFromHeightMap);

	float mixFactor = 1.0 - dot(normal, vec3(0, 0, 1));
//	vec3 outCol = mix(bg, min(vec3(5.5), vec3(1.0, 1.0, 1.0) * 50.5), mixFactor) + sunStr;
//	vec3 outCol = mix(bg, skyColor * 50.5, mixFactor) + sunStr;
	vec3 outCol = mix(bg, skyColor * 0.5, mixFactor) + sunStr;

//	fragColor.xyz = height.zzz;
//	fragColor.xyz = 0.5 + normalFromHeightMap;


	vec2 position = vfPosition;
	vec3 normal = GetSurfaceNormal();
//	vec3 rayDirOrg = refract(camDir, vec3(0.0, 1.0, 0.0), airToWater);
	vec3 rayDir = refract(camDir, normal, airToWater);
	vec3 bottom = rayDir * waterDepth / rayDir.z;
	vec2 texcoord = (position.xy + bottom.xy) * vec2(0.5, -0.5) + vec2(0.5, 0.5);

	vec3 bg = GetBGColor(texcoord);

	vec3 skyColor = texture(sampler5, normal.xy * vec2(0.5, -0.5) + vec2(0.5, 0.5)).xyz;

	// gamma -> linear
	bg = pow(bg, invGamma3) * 0.5;
