new underwater colors

actorid
scrawl 13 years ago
parent 2bbbff2b75
commit fbaedd2c3a

@ -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);
}

@ -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);

@ -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
}

Loading…
Cancel
Save