Game Development Community

More realistic waters edge

by Ian Winter · in Torque Game Engine Advanced · 07/19/2005 (4:59 am) · 85 replies

One of the things I've noticed about a lot of modern games, which also goes for TSE in it's current state is they have these gorgeous terrains and gorgeous water but there's no decent transition between the waters edge and the land itself. Some games do have the gentle waves as the water laps onto the shore for example in Farcry and in Settlers V however I'm wondering how hard it would be to do something like this in TSE? I'm guessing it's something that needs to be done at code level and I'm imagining it's a lot of work but I'd like some reassurance of that because if there is a fairly easy way of doing it I think it'd go a long way to improving the feel of certain scenes in the game. Does anyone have any idea what is involved in doing something like this and how hard it is if it's even feasible at all?

Thanks in advance!
Page «Previous 1 2 3 4 5 Last »
#1
07/19/2005 (9:26 am)
I agree, this "effect" is the main thing missing now...
I'm gona take a guess and say this will be a feature us mortals will be able to
purchase as an add-on pack (like the lighting pack for TGE)

So come on your guru elite pack making people, how about it ??

Of course it would be great if one of the GG guys added it for us
Brain... this sounds right up your alley.. nudge nudge :D

Hewster
#2
07/19/2005 (10:44 am)
Brain... Does that make me Pinky? :P

I agree, some good shore effects would be pretty awesome. There are a bunch of ways to do it, some simple, some not so simple. I know Brian and I would love to work on that sort of thing - that's the sort of research project that can be a lot of fun. But there's a lot of bugs to be fixed, features to be completed, and so forth, so we have to leave it to the community... :)
#3
07/19/2005 (11:01 am)
Lol Brian the Brain :)
and Ben the err Brilliant !

Yeah I understand lots of stuff to-do before you can devote time to "extras"

But I can see the news items now... Torque TSE better water effects than FarCry !!!

hehe

Just wish I could help more :( But my skills are more in the game entity / game play
fields... not much of a GFX programmer... seeing that I learnt all my game programming
skills for making mods (that's how I see I'll be using TSE btw)

Some-one please step-up to the plate, I know we have members with the skills
to add this extra functionality to TSE's great new water system !!!

From what Ben just posted, it sounds like he has some ideas how to implement
this... I'm sure he'll help whoever takes up the challenge :)

Hewster
#4
07/19/2005 (11:08 am)
Quote:
But there's a lot of bugs to be fixed, features to be completed, and so forth, so we have to leave it to the community... :)

So that means you guys won't be doing it? Brian mentioned in his plan that it was on his plate, a while back.
Just curious.
#5
07/19/2005 (5:17 pm)
I did? I thought I said you guys should do this sort of stuff ;) It's like Ben said, we've got a bunch of other things that are more important to finish. I've already spent too much time on the water.
#6
07/20/2005 (1:17 am)
Any pointers on where to begin researching how to do something like this ;) ?
#7
07/20/2005 (1:57 am)
You should create an alpha map by calculating the distance from the water block to the ground/terrain. You can then use this alpha map to render the water, most likely adding it as a pass in the water shader(s). By the way, TGE's water does exactly this, so you might want to read the code there.
#8
07/20/2005 (10:42 am)
As Xavier said you need to calculate a water depth map for the waterblock first. This can be used to tweak the opacity of the surface.

Quick thoughts on shoreline effects.

To build geometry for the shoreline. Assuming you lay a triangle mesh over the waterblock, you need to find triangles that have points both above and below terrain. You might need to massage these to form a better shoreline shape.

Now for each triangle generate direction vectors between the triangle vert above the terrain to each vert under the terrain. Average these together and you should have the direction your shore foam should flow per triangle.

Using this you should be able to generate texture uvs for the triangles and render a shoreline.

Still there is possibly a better image based method that i'm not thinking of.
#9
07/20/2005 (2:53 pm)
Speaking of water's edge though, I've noticed that if you look right where the waterblock meets the terrain instead of reflecting the last bit of terrain, it seems to reflect as if you were looking from underneath the terrain, which of course the terrain is one-sided so you see straight through it. I was wondering if anyone else saw this and if there were plans to tweak it. Not that it's really any problem, the water and terrain is already superb.
#10
07/20/2005 (3:49 pm)
Yeah Will it's a bug and I think confirmed too. It also happends if you look at the terrain from a certain angle (above the water) and then change the cameras angle very fast.
#11
07/20/2005 (3:55 pm)
Hmm. I might have a look at this one.. sounds kinda fun.

I was wondering about it myself... Ive got some time for these things when I get back to work, so I'll devote a few days to having a look at the issue.

Has anyone got any good examples of this kind of thing in other games as a reference?
#12
07/20/2005 (4:20 pm)
How about some real world reference instead?
#13
07/20/2005 (4:33 pm)
Farcry has some really nice shoreline effects, I guess.
#14
07/21/2005 (5:04 am)
I always thought (from own watching experience) that water reflection and refraction is based on light intensity.

If you have more light emitted from the surface below the water (ground) than you can see more of the ground... if you have a bright spot reflected from the sun you see the reflection instead. I havent tried anything and i couldnt look up the reference in some physics books but i would make sense.

Technically you would accomplish this effect like this:

1. Render the Terrain without water (like TSE does anyway) but you need to render the underwater fog in this pass too. So that you can simulate light beeing swallowed by the big ocean corpus (the color of the fog will be the waters color)

2. Render the Reflection map (like you do with current water)

3. for every water pixel check brightness for reflection and brightness for refraction and compute the final color by weighting them.

I havent tested this so i cant tell if it works or how it will look like... maybe i will do some research on it later


This way you would have a natural shoreline (you would even be able to render whales under the surface dynamically) the only thing that would needed to be done is maybe waves and foam... Final Fantasy XI does that pretty nice
#15
07/21/2005 (10:45 am)
@Florian - Still your right we need to get some sort of underwater fogging. What happens in water is different than thru the atmosphere as you loose red light wavelengths first. I've thought that the better way to do underwater scenes is via a modified rayleigh scattering technique like what is used for improved atmospheric fogging.
#16
07/21/2005 (11:19 am)
I didnt mean the fog for underwater rendering but rather for realistic rendering of water surfaces using reflection/refraction.

this picture demonstrates what i'm thinking about.
www.duke.edu/~cec6/BERMUDA/Beaches/south%20shore.jpg
if you watch a water surface you will notice that part of the light you see comes from below the water surface via refraction and another part comes from above via reflection (there is an easy relaxing experiment involving a bathtub and candles).

I noticed that if you have more light coming from below the water surface you will actually see the object emmiting the light underwater and not the object that would be reflected. So the amount of light you will see at a specific point on a water surface is a combination of the light reflected and the light refracted.

The underwater fog is there to simulate the thick density of water so that you cant see reflected light from a very deep rift in the see.

i actually think that this effect is quite easy (and fast to do)
#17
07/21/2005 (5:56 pm)
The shoreline in farcry (best images I could find)

iddqd.ru/doom/info/d3_vs_hl2/water-fc.jpgright-thoughts.us/images/uploads/FarCry0000-new.jpgwww.kfj.f2s.com/far-cry-3.jpg
#18
07/21/2005 (6:51 pm)
Joseph, those are with PS2.0 hardware. Looks much better with 3.0
#19
07/21/2005 (6:53 pm)
Stefan, I just posted what I found :-\

I really should get a copy of the game... looks pretty sweet.
#20
07/23/2005 (12:43 am)
Looks like a good idea.
could use that with my game
I might make a pack for this as soon as ms3 is released for tse (material differences)
If I do I will release it too you guys
Page «Previous 1 2 3 4 5 Last »