Jump to content
  • Advertisement
Sign in to follow this  
_WeirdCat_

How to mix water reflection color with water refraction color, how to draw it properly

This topic is 1120 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

So the main problem is when the sun goes down i get sharer agnles and the look of the water looks really bad

 

for now i do (reflectionColor + refractionColor) / 2.0 -> and that gives me such results

 

2015_09_24_19.12.29.jpg

2015_09_24_19.21.00.jpg

 

2015_09_24_19.22.58.jpg

2015_09_24_19.23.32.jpg

 

 

 

 

 

 

how can i fix that?

Share this post


Link to post
Share on other sites
Advertisement

Well, i can tell you the hack i used first.

 

I cheated.

 

I created two materials in my game, one for water during the day and another for water during nighttime as the way light behaves had the same kind of odd issues for me. In absence of a proper solution, i simple lerp'ed between these two materials during sunset, along with other settings.

 

My next and proper solution (in unreal engine) was to completely turn off the directional light at night, set the light colour to black, and lerp the skybox colour down to nearly nothing so it's nothing more than a very dim light as would be emitted by starlight and moonlight. I also slightly increased the opacity of the water.

 

Of course my game doesn't have a moon in view, so this makes things a bit easier.

 

Is this a custom engine you are using?

 

Let me know if this helps at all!

Edited by braindigitalis

Share this post


Link to post
Share on other sites

aye its custom, however i think that answer doesn't help me at all ;] im searching for something like PBR

 

 

images show only a quad with a normalmap applied so i can reflect refract directional light (sun)

 

 

i rather though about the night/day cycle like when the sun goes down the less the light the more the moon is visible so basically (something like -dot(sun_pos, watersurf_normal) will tell me how much of sunlight and moonlight i can put where if that dot is <= 0 then moonlight brigts at full intensity. 

 

However i need to fix the shader to make this more realistic look.

 

the best thing would be not to use cubemapping, and all samples i saw on the net use that.

Edited by ?W ?I ?R ?E ?D ? ?C ?A ?T

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!