# Looking for suggestions for water shader.

This topic is 4687 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Greetings. Ive been working recently on a water effect. I am to the point where i have a reflection map and refraction map for my water. Im looking for suggestion on how to use/blend them. i have two shots : here and here. and im using (HLSL) :
float3 fReflect = tex2Dproj(sReflect, i.Uv).rgb;
float3 fRefract = tex2Dproj(sRefract, i.Uv).rgb;

float3 fColorWA = { 0.13f, 0.13f, 0.68f };
float3 fColorRR = lerp(fRefract, fReflect, 0.4f);

return float4(lerp(fColorRR, fColorWA, 0.3f), 1.0f);


I dont fell like its looking particulary good. Any tips/pointers on how i should use both "maps" would be appreciated. Im trying to get somekind of clear tropical water. Thanks you.

##### Share on other sites
For this line:
"float3 fColorRR = lerp(fRefract, fReflect, 0.4f);"

I'd replace 0.4f with a Fresnel approximation equation, e.g. (1-cos(N dot V))^5

##### Share on other sites
Thanks for the suggestion.

In the equation (1-cos(N dot V))^5
N stand for the normal vector, correct?
What does V stand for?

Sorry but im not very familiar with Fresnel approximation equation(s).

##### Share on other sites
Normalised Eye->Surface vector, IIRC.

##### Share on other sites
V stands for normalized vector to viewer...

##### Share on other sites
Quote:
 Original post by superpigNormalised Eye->Surface vector, IIRC.

:) You were first.

Note, that although our explanations are different, they're both correct, because of cosinus nature.

##### Share on other sites
Yes as they said using a proper Fresnel aprox can grealy improve the look.

I would suggest the use of a normal map for additional wave detail. It can greatly improve the look of the wave without too much cost.

##### Share on other sites
Thanks everyone, im going to try this out :)