Thank You HeinKill-
Now, after a little touch up, adding some breakers here and shadow lines there-
If you have v2.11, go to the Weather folder, and pick up the file "Lowdown_water.fx" and copy it to
the Weather folder in your install, renaming it to water.fx (you can back up the original somewhere).
Otherwise, it is just a text file, so copy it from here and save it similarly as water.fx . This will
readjust the waves so that they are a reasonable size for their degree (absence) of chop, and make it
far easier to judge your height when flying low over the sea. The stock waves made it look like you
were at a height of 10ft when you were at 500ft. This mod only came with 2.11.
(I was going to put this in a {code-/code} box, but it turns out it's much easier to select and paste
as straight text):
//------------------------------------------------------------------------------
// Water.fx
//
// Author: Miro "Jammer" Torrielli
//
// Last Update: 17 May 2005
//
// **Modded Mar 21 2010, "Rummy" **
//
//------------------------------------------------------------------------------
float4x4 mView;
float4x4 mViewProj;
float3 ViewPos;
float4 WaterCol;
// float SpecularExponent = -10.0f;
// float SpecularFactor = -1.0f;
float FogStart;
float RFogRange;
texture NormalMap; // < string name = "weather\\wave2.dds";>;
texture EnvMap; // < string name = "weather\\Cube.dds";>;
texture FresnelMap;
float4 normalModifier = {15.0f,4.0f, 1.0f, 1.0f};
sampler NormalSamp = sampler_state
{
Texture = <NormalMap>;
MipFilter = NONE;
MinFilter = LINEAR;
MagFilter = LINEAR;
// MipFilter = ANISOTROPIC;
// MinFilter = ANISOTROPIC;
// MagFilter = ANISOTROPIC;
AddressU = WRAP;
AddressV = WRAP;
};
samplerCUBE EnvSamp = sampler_state
{
Texture = <EnvMap>;
MipFilter = NONE;
MinFilter = LINEAR;
MagFilter = LINEAR;
// MipFilter = ANISOTROPIC;
// MinFilter = ANISOTROPIC;
// MagFilter = ANISOTROPIC;
AddressU = WRAP;
AddressV = WRAP;
AddressW = WRAP;
};
sampler FresnelSamp = sampler_state
{
Texture = <FresnelMap>;
MipFilter = NONE;
MinFilter = LINEAR;
MagFilter = LINEAR;
AddressU = CLAMP;
AddressV = CLAMP;
};
struct WATER_VS_INPUT
{
float3 Pos : POSITION;
float2 NormUV : TEXCOORD0;
};
struct WATER_VS_OUTPUT
{
float4 Pos : POSITION;
float2 NormUV : TEXCOORD0;
float3 vView : TEXCOORD1;
float Fog : TEXCOORD2;
};
WATER_VS_OUTPUT WaterVShader(WATER_VS_INPUT i)
{
WATER_VS_OUTPUT o;
o.Pos = mul(float4(i.Pos.xyz,1),mViewProj);
o.Fog = dot(i.Pos,float3(mView._13,mView._23,mView._33)) + mView._43;
o.Fog = 1 - (o.Fog-FogStart) * RFogRange;
o.NormUV = i.NormUV;
o.vView = normalize(i.Pos.xyz - ViewPos);
return o;
}
float4 WaterPShader(WATER_VS_OUTPUT i) : COLOR
{
float4 o;
float3 vNorm = tex2D(NormalSamp,i.NormUV * normalModifier.xyzw)*2 - 1;
//float3 vNorm = tex2D(NormalSamp,i.NormUV)*2 - 1;
float3 vRefl = normalize(reflect(i.vView,vNorm));
// float4 specular = pow(saturate(dot(vRefl, i.vView)), SpecularExponent); // R.V^n
//o.rgb = lerp(WaterCol,texCUBE(EnvSamp,vRefl),1.50f * (specular, dot(vRefl,vNorm)));
// o.rgb = lerp(WaterCol,texCUBE(EnvSamp,vRefl),tex1D(FresnelSamp,dot(vRefl,vNorm))+ 1.of * (specular, dot(vRefl,vNorm)));
o.rgb = lerp(WaterCol,texCUBE(EnvSamp,vRefl),tex1D(FresnelSamp,dot(vRefl,vNorm)));
o.a = i.Fog;
return o;
}
technique T1
{
pass P0
{
vertexshader = compile vs_1_1 WaterVShader();
pixelshader = compile ps_2_0 WaterPShader();
}
}
struct FILLER_VS_INPUT
{
float3 Pos : POSITION;
float2 NormUV : TEXCOORD0;
};
struct FILLER_VS_OUTPUT
{
float4 Pos : POSITION;
float Fog : TEXCOORD0;
};
FILLER_VS_OUTPUT FillerVShader(FILLER_VS_INPUT i)
{
FILLER_VS_OUTPUT o;
o.Pos = mul(float4(i.Pos.xyz,1),mViewProj);
o.Fog = dot(i.Pos,float3(mView._13,mView._23,mView._33)) + mView._43;
o.Fog = 1 - (o.Fog-FogStart) * RFogRange;
return o;
}
float4 FillerPShader(FILLER_VS_OUTPUT i) : COLOR
{
float4 o;
o.rgb = WaterCol;
o.a = i.Fog;
return o;
}
technique T0
{
pass P0
{
vertexshader = compile vs_1_1 FillerVShader();
pixelshader = compile ps_2_0 FillerPShader();
}
}