Water Rendering

Everything about development and the OpenMW source code.
User avatar
werdanith
Posts: 295
Joined: 26 Aug 2011, 16:18

Re: Water Rendering

Post by werdanith »

scrawl wrote:werdanith, wasn't your interior water working earlier (at the point where jhooks stopped)?
If by working you mean that I didn't see any water but when I got underwater the rendering changed a little, yes that has changed now, no difference underwater in interiors any more. I've never seen any actual water on any machine yet though.

To get the game to stop crashing I did change this part:

Code: Select all

if (esm.isNextSub("INTV") || esm.isNextSub("WHGT"))
            esm.getHT(water);
and for the record I'm using unpatched vanilla Morrowind.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Water Rendering

Post by Zini »

Somewhat unrelated to the discussion above, I found some more problems:

- The getWaterLevel function works on the ESM record not on the cell store.

- In the default starting cell, I get water. I don't think that is right.

btw. I reopened the issue. Seems we still have some fixing to do.
User avatar
werdanith
Posts: 295
Joined: 26 Aug 2011, 16:18

Re: Water Rendering

Post by werdanith »

Zini wrote: - In the default starting cell, I get water. I don't think that is right.
If by default starting cell you mean Beshara, then it's right. Beshara does have water.
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Water Rendering

Post by scrawl »

werdanith, chris: try if this works:

Code: Select all

        // Interior cells
        if (esm.isNextSub("INTV"))
        {
            int waterl;
            esm.getHT(waterl);
            water = (float) waterl;
        }
        else if (esm.isNextSub("WHGT"))
            esm.getHT(water);
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Water Rendering

Post by scrawl »

werdanith wrote: If by working you mean that I didn't see any water but when I got underwater the rendering changed a little, yes that has changed now, no difference underwater in interiors any more. I've never seen any actual water on any machine yet though.
I'm going to blame that on your gpu having problems with the water material. But it doesn't matter now, it will be replaced at a later point with a completely new one.
Chris
Posts: 1626
Joined: 04 Sep 2011, 08:33

Re: Water Rendering

Post by Chris »

scrawl wrote:werdanith, chris: try if this works:

Code: Select all

        // Interior cells
        if (esm.isNextSub("INTV"))
        {
            int waterl;
            esm.getHT(waterl);
            water = (float) waterl;
        }
        else if (esm.isNextSub("WHGT"))
            esm.getHT(water);
That works. GetWaterLevel gives -100 and the screen hue changes like outside.
User avatar
werdanith
Posts: 295
Joined: 26 Aug 2011, 16:18

Re: Water Rendering

Post by werdanith »

scrawl wrote:werdanith, chris: try if this works:

Code: Select all

        // Interior cells
        if (esm.isNextSub("INTV"))
        {
            int waterl;
            esm.getHT(waterl);
            water = (float) waterl;
        }
        else if (esm.isNextSub("WHGT"))
            esm.getHT(water);
This fixes the water level issue in interiors, I get -100 in Beshara.
scrawl wrote:
werdanith wrote: If by working you mean that I didn't see any water but when I got underwater the rendering changed a little, yes that has changed now, no difference underwater in interiors any more. I've never seen any actual water on any machine yet though.
I'm going to blame that on your gpu having problems with the water material. But it doesn't matter now, it will be replaced at a later point with a completely new one.
Oh come on! This is a plain blue plane we are talking about it's not rocket surgery. How come both Ogre water samples work correctly on both machines and we can't get a damn blue plane to render? How did people do water before opengl 4 came along?
User avatar
Greendogo
Posts: 1467
Joined: 26 Aug 2011, 02:04

Re: Water Rendering

Post by Greendogo »

Out of curiosity, in relation to sounds, at what height above water does the player have to be before they start or stop hearing water sounds?
User avatar
werdanith
Posts: 295
Joined: 26 Aug 2011, 16:18

Re: Water Rendering

Post by werdanith »

Greendogo wrote:Out of curiosity, in relation to sounds, at what height above water does the player have to be before they start or stop hearing water sounds?
From what I've observed it's around the same cutoff distance as other sound sources like say waterfalls, maybe 2000 units from our engine's perspective. But the formula is more complicated than just height. The game calculates the distance to the closest water source that does not have terrain covering it. In interior cells that makes things simple, it's just the dx between the player and the water surface. In exteriors on the other hand we'll need a way to detect the closest distance to the water plane that is not covered by terrain (Hopefully one that doesn't do excellent on newer hardware and destroys the fps on older ones).
User avatar
Greendogo
Posts: 1467
Joined: 26 Aug 2011, 02:04

Re: Water Rendering

Post by Greendogo »

werdanith wrote:The game calculates the distance to the closest water source that does not have terrain covering it. In interior cells that makes things simple, it's just the dx between the player and the water surface.
In vanilla Morrowind I noticed this was the method used, vs. the exterior method because sometimes you could hear the water in part of an interior cell very far form any water source. I count that as a bug or oversight in the vanilla-Morrowind engine. Wouldn't using the same technique in interior cells be faster than it is in exterior cells?
Post Reply