ok.. i did it!
Spronated by your suggestion i trid to modify fresnel water, adding the fog distance color.
I modified like this:
Original:
//--------------
// pixel shader
//--------------
float4 ReflRefr(output IN) : COLOR
{
float Mask=tex2D(WaterMask,IN.Tex0).x;
float4 Distort=tex2D(Waterbump,IN.Tex1);
Distort=Distort+tex2D(Waterbump,IN.Tex2)-1;
Distort=Distort*(IN.RefrProj.z*WaterBump)*Mask;
float3 Refraction=tex2Dproj(WaterRefract,IN.RefrProj+Distort)*RefractColor;
float3 Reflection=tex2Dproj(WaterReflect,IN.ReflProj+Distort)*ReflectColor;
float Fresnel=tex2D(Fresnel,IN.ViewVec).x;
float3 Water=lerp(Reflection,Refraction,Fresnel);
return float4(Water,Mask);
}
float4 Refr(output IN) : COLOR
{
float Mask=tex2D(WaterMask,IN.Tex0).x;
float4 Distort=tex2D(Waterbump,IN.Tex1);
Distort=Distort+tex2D(Waterbump,IN.Tex2)-1;
Distort=Distort*(IN.RefrProj.z*WaterBump)*Mask;
float3 Refraction=tex2Dproj(WaterRefract,IN.RefrProj+Distort)*RefractColor;
float WaterFog=saturate(length(IN.WaterFog));
return float4(lerp(Refraction,WaterFogColor,WaterFog),Mask);
}
Modified:
//--------------
// pixel shader
//--------------
float4 ReflRefr(output IN) : COLOR
{
float Mask=tex2D(WaterMask,IN.Tex0).x;
float4 Distort=tex2D(Waterbump,IN.Tex1);
Distort=Distort+tex2D(Waterbump,IN.Tex2)-1;
Distort=Distort*(IN.RefrProj.z*WaterBump)*Mask;
float3 Refraction=tex2Dproj(WaterRefract,IN.RefrProj+Distort)*RefractColor;
float3 Reflection=tex2Dproj(WaterReflect,IN.ReflProj+Distort)*ReflectColor;
float Fresnel=tex2D(Fresnel,IN.ViewVec).x;
float3 Water=lerp(Reflection,Refraction,Fresnel);
float WaterFog=saturate(length(IN.WaterFog));
return float4(lerp(Water,WaterFogColor,WaterFog),Mask);
}
float4 Refr(output IN) : COLOR
{
float Mask=tex2D(WaterMask,IN.Tex0).x;
float4 Distort=tex2D(Waterbump,IN.Tex1);
Distort=Distort+tex2D(Waterbump,IN.Tex2)-1;
Distort=Distort*(IN.RefrProj.z*WaterBump)*Mask;
float3 Refraction=tex2Dproj(WaterRefract,IN.RefrProj+Distort)*RefractColor;
float WaterFog=saturate(length(IN.WaterFog));
return float4(lerp(Refraction,WaterFogColor,WaterFog),Mask);
}
was not so hard.. anyway w/o you suggestions i always SLEEP waiting for external help like a noob..
So thx GG
Lucka - gawteam coder - www.gawgames.com