Jump to content
  • Advertisement
Sign in to follow this  
CycloCode

Looking for suggestions for water shader.

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
Share on other sites
Quote:
Original post by superpig
Normalised Eye->Surface vector, IIRC.

:) You were first.

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

Share this post


Link to post
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 this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!