Water

OvermindDL1

30-01-2006 22:31:12

I have two types of water in mind and trying to think of efficient ways to implement them in PLSM2.

1) Basic infinite water plane, would be rendered as a usual infinite plane (well, out to render distance), but would be interesting in creating highly detailed textures or shader effects up close (waves). Could also be done by the same pages plsm2 uses, loading and destroying in the listeners, this would allow the lods and such as well, few polys when far (maybe 2 polys when very far), to detailed up close.

2) Modeled water, in that it would be like a water plane, but could/would be varying heights and could merge with the terrain, using a heightmap like the terrain so you could have it sit in lakes and run down streams up in mountains to a massive lake below, bit more resource intensive, but barely. Would require far more work, but would be more useful overall.

Does anyone have any more ideas other then these two, and which would any of you implement, why, and how?

Also, any thoughts about setting up PLSM2 so it supports method two natively, two sets of heightmaps and textures interwoven? If someone was feeling daring, they could have the water heightmap actually merge with the heightmap of the other if someone turned on such a feature, so it would flow accurately enough (waves, not necessarilly texutre, would be difficult, and being able to do things like move water density from an area to another area to keep the water flowing at a constant rate would be a nice addition)...

jacmoe

30-01-2006 23:01:36

The easiest and most flexible way IMO is to use quads, ie not to think of water as an infinite plane, but yet another object, of which you can have many. :wink:

Of course these quads has a shader attached to them.

tuan kuranes

31-01-2006 08:28:05

Jacmoe is right.

1) Paging not needed. water is always water. Infinite plane water doesn't need to be in scene manager.

2) "merge with the terrain" has the same problem. water is always water... so it's planes. which is rendered best using quads. plsm2 renders terrain with fixed complexity tile. using terrain tile would be far overkill to render just planes. Water animation must be done using shaders, as CPU water is way too slow.

So what you can do is a "WaterManager" that handles list of quad. perhaps regrouped as static geometry, that uses plsm2 listener mechanism to show/hide water planes.

OvermindDL1

31-01-2006 09:00:06

Method 1, got it.

LizzardDude

31-01-2006 17:43:19

As far as I understand the Topic there´s a difference in both types a little later on - when it comes to the physics stuff.

In Morrowind you have the Method1 water type. Infinite water plane, stays exactly on the same level.

This one seems quite easy to handle. For starters: Below some certain point of the hightmap -> start swiming.
The downside: No nifty little lakes somewhere in the mountains.

Also it´d be nice to have a little more than shader waves... err.. like in FarCry where waves come up the shore a little.

Since I have too much work to do (and thus getting a little more stupid every day) my thoughts about realization are quite limited...

OvermindDL1

01-02-2006 00:57:55

I don't really care about waves on shore, I can fake those using mesh's if I wanted them, but lakes and such in mountains is what I was going for...