Sign in to follow this  
jollyjeffers

Fresnel reflection/refraction from a fixed-angle camera

Recommended Posts

I've been working through the various components of a possible future project... doing a bit of research here, knocking up a demo there, usual sort of thing. Anyway, I'm looking at a terrain engine for an RTS. The terrain will have water in the form of lakes and/or oceans. Nothing hugely amazing there... But, I want to be able to render reflections/refractions for this water (as does everyone it seems), and modulate the two accordingly with a fresnel term. Now, the cause of my question is this - given a typical RTS game (e.g. C&C type games) where the camera's angle relative to the objects (and terrain) stays constant (although position changes), would calculating a fresnel term for water effects be pointless?. Even if the screen had a large expanse of water on display, the relative angles between the extreme pixels/verticies would not be that different - thus generating a near identical fresnel term. If it's going to be near identical and constant, it could be pre-computed. Bottom line is, is there a good reason that I haven't thought of to do all the extra work to implement it "properly" and all of the extra processing power required to execute said effect properly? Any thoughts are appreciated, cheers, Jack

Share this post


Link to post
Share on other sites
if your water is always at nearly same angle of reflection, it may be pointless.

If your camera is fixed, and your waves in water is small, you can just use "screen-space" fresnel map, i think. This map should contain fresnel coefficient depending to screen-space coordinates, and may even be stored in 1D texture...

Share this post


Link to post
Share on other sites
Quote:
if your water is always at nearly same angle of reflection, it may be pointless.
Well think of it more like this... you have a target that the camera is looking at, and this moves around as you scroll the screen. The camera itself sits 100 units above it and 25 units "down" from it. The only important factor here is that the target:camera angle/ratio/relationship is always the same.

By this logic, if the water were a flat surface (waves immitated using bump maps for example) then the angles would stay pretty much the same wherever the camera were actually located.

Quote:
you can just use "screen-space" fresnel map, i think.
I think I've seen some references to this, but I'm not familiar with it... I'll see what I can find (unless anyone here happens to have any good references to hand [wink]).

Cheers,
Jack

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