Sign in to follow this  
apat

Lightsource reflections in water

Recommended Posts

Hello! I'm about to try to write some glsl shader to reflect things on a water surface. Render the world mirrored upside down to a texture and let the shader make it wavy and so on.. A problem I thought about is how lightsources are reflected in the water in real life, the reflection get stretched and pointing towards the viewer. The classic example is the sun at sunset near the horizon. I dont know why this is happening but it wont happen in the shader doing it in the above way I guess. I guess I could draw the lightsources with some stretched glare when rendering the texture but sounds like a hack. Anyone knows about the real physics/reason for this stretching?

Share this post


Link to post
Share on other sites
Quote:
Original post by apat
Anyone knows about the real physics/reason for this stretching?
It is just because the angle of incidence is higher (less acute).

The sun is just a big light source and the water a bumpy reflective surface, so it can easily be done with standard specular lighting models.

If you are wanting some sort of image based lighting, then I am not sure how you go about that.

Regards,
ViLiO

Share this post


Link to post
Share on other sites
Like ViLiO said, it's because the sun is low in the sky and the water's bumpy.

If the water were perfectly flat, you'd see a circular sun reflection. However, when the sun is setting, it only takes a very small perturbation in the water's surface for it to catch the sun. This gives the effect of an elongated reflection when averaged over many small ripples, but in fact the reflections are perfectly affine.

Regards
Admiral

Share this post


Link to post
Share on other sites
Specular reflections rendered using the half-angle approach do look elongated, and do a better job at creating the "coarse reflective surface" aspect.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this