diff --git a/Effects/water.eff b/Effects/water.eff index cf948f1ab..f2b40145d 100644 --- a/Effects/water.eff +++ b/Effects/water.eff @@ -52,13 +52,21 @@ <internal-format>normalized</internal-format> </texture> <texture n="7"> - <image>Textures/Globe/ocean_depth_1.jpg</image> + <image>Textures/Globe/ocean_depth_1.png</image> <type>2d</type> <filter>linear-mipmap-linear</filter> <wrap-s>repeat</wrap-s> <wrap-t>repeat</wrap-t> <internal-format>normalized</internal-format> </texture> + <texture n="8"> + <image>Textures/Globe/globe_colors.jpg</image> + <type>2d</type> + <filter>linear-mipmap-linear</filter> + <wrap-s>repeat</wrap-s> + <wrap-t>repeat</wrap-t> + <internal-format>normalized</internal-format> + </texture> <texture n="10"> <image>Textures/Terrain/packice-overlay.png</image> <type>2d</type> @@ -380,6 +388,27 @@ <use>texture[10]/internal-format</use> </internal-format> </texture-unit> + <texture-unit> + <unit>8</unit> + <image> + <use>texture[8]/image</use> + </image> + <type> + <use>texture[8]/type</use> + </type> + <filter> + <use>texture[8]/filter</use> + </filter> + <wrap-s> + <use>texture[8]/wrap-s</use> + </wrap-s> + <wrap-t> + <use>texture[8]/wrap-t</use> + </wrap-t> + <internal-format> + <use>texture[8]/internal-format</use> + </internal-format> + </texture-unit> <program> <vertex-shader>Shaders/water-ALS.vert</vertex-shader> @@ -425,6 +454,11 @@ <type>sampler-2d</type> <value type="int">7</value> </uniform> + <uniform> + <name>water_colormap</name> + <type>sampler-2d</type> + <value type="int">8</value> + </uniform> <!-- normalmap is .dds--> <uniform> <name>normalmap_dds</name> diff --git a/Shaders/water-ALS-high.frag b/Shaders/water-ALS-high.frag index a3ae2bc8e..bdb260b08 100644 --- a/Shaders/water-ALS-high.frag +++ b/Shaders/water-ALS-high.frag @@ -9,6 +9,7 @@ #version 120 uniform sampler2D water_normalmap; +uniform sampler2D water_colormap; uniform sampler2D water_dudvmap; uniform sampler2D sea_foam; uniform sampler2D perlin_normalmap; @@ -219,12 +220,12 @@ void main(void) float noise_2500m = Noise3D(rawPos.xyz, 2500.0); // get depth map + vec4 colorTexel = texture2D(water_colormap, TopoUV); vec4 topoTexel = texture2D(topo_map, TopoUV); - topoTexel.a = 0.8*topoTexel.r+0.2*topoTexel.g; - topoTexel.a = -topoTexel.a*topoTexel.a + 2*topoTexel.a; + topoTexel.a = topoTexel.r; float floorMixFactor = smoothstep(0.3, 0.985, topoTexel.a); - vec3 floorColour = topoTexel.rgb; + vec3 floorColour = colorTexel.rgb; mat4 RotationMatrix; diff --git a/Textures/Globe/ocean_depth_1.jpg b/Textures/Globe/globe_colors.jpg similarity index 100% rename from Textures/Globe/ocean_depth_1.jpg rename to Textures/Globe/globe_colors.jpg diff --git a/Textures/Globe/ocean_depth_1.png b/Textures/Globe/ocean_depth_1.png new file mode 100644 index 000000000..909fcac41 Binary files /dev/null and b/Textures/Globe/ocean_depth_1.png differ