diff --git a/files/water/underwater.cg b/files/water/underwater.cg index b853dd5355..829d34347c 100644 --- a/files/water/underwater.cg +++ b/files/water/underwater.cg @@ -28,14 +28,15 @@ float4 main_fp_nomrt (float2 iTexCoord : TEXCOORD0, float3 noiseCoord : TEXCOORD1, uniform sampler2D RT : register(s0), uniform sampler2D NormalMap : register(s1), - uniform sampler2D CausticMap : register(s2), - uniform float4 tintColour) : COLOR + uniform sampler2D CausticMap : register(s2)) : COLOR { float4 normal = tex2D(NormalMap, noiseCoord) * 2 - 1; - return tex2D(RT, iTexCoord + normal.xy * 0.015) + - (tex2D(CausticMap, noiseCoord) / 5) + - tintColour ; + float4 col = tex2D(RT, iTexCoord + normal.xy * 0.015) + + (tex2D(CausticMap, noiseCoord) / 5); + col.xyz = lerp(col.xyz, float3(0.15, 0.40, 0.40), 0.4); + return col; + } @@ -45,8 +46,7 @@ float4 main_fp (float2 iTexCoord : TEXCOORD0, uniform sampler2D RT : register(s0), uniform sampler2D NormalMap : register(s1), uniform sampler2D CausticMap : register(s2), - uniform sampler2D DepthMap : register(s3), - uniform float4 tintColour) : COLOR + uniform sampler2D DepthMap : register(s3)) : COLOR { float4 normal = tex2D(NormalMap, noiseCoord) * 2 - 1; @@ -54,8 +54,8 @@ float4 main_fp (float2 iTexCoord : TEXCOORD0, depth = saturate(depth / 2000.f); float4 color = tex2D(RT, iTexCoord + normal.xy * 0.015) + - (tex2D(CausticMap, noiseCoord) / 5) + - tintColour; + (tex2D(CausticMap, noiseCoord) / 5); + color.xyz = lerp(color.xyz, float3(0.15, 0.40, 0.40), 0.4); - return lerp(color, float4(0, 0.65, 0.65, 1), depth); + return lerp(color, float4(0.15, 0.40, 0.40, 1), depth); } diff --git a/files/water/water.cg b/files/water/water.cg index bf6d04c5cc..ad0ff57f7e 100644 --- a/files/water/water.cg +++ b/files/water/water.cg @@ -112,8 +112,8 @@ void main_fp oColor.xyz = lerp(refraction.xyz, reflection.xyz, opacity); - oColor.xyz += isUnderwater * float3(0, 0.35, 0.35); // underwater tint color - oColor.xyz = lerp(oColor.xyz, float3(0, 0.65, 0.65), saturate(isUnderwater * (iDepth / 2000.f))); // underwater fog + oColor.xyz = lerp(oColor.xyz, float3(0.15, 0.40, 0.40), isUnderwater*0.6); // underwater tint color + oColor.xyz = lerp(oColor.xyz, float3(0.15, 0.40, 0.40), saturate(isUnderwater * (iDepth / 2000.f))); // underwater fog // add fog //float fogValue = saturate((iDepth - fogParams.y) * fogParams.w); diff --git a/files/water/water.material b/files/water/water.material index a2a6b3e2dc..d1f7fcf494 100644 --- a/files/water/water.material +++ b/files/water/water.material @@ -151,7 +151,6 @@ material Water/CompositorNoMRT fragment_program_ref UnderwaterEffectFP_NoMRT { - param_named tintColour float4 0 0.35 0.35 1 } texture_unit RT @@ -194,7 +193,6 @@ material Water/Compositor fragment_program_ref UnderwaterEffectFP { - param_named tintColour float4 0 0.35 0.35 1 param_named_auto far far_clip_distance }