Water Rendering

Everything about development and the OpenMW source code.
Post Reply
Yacoby
Posts: 119
Joined: 30 Sep 2011, 09:42

Re: Water Rendering

Post by Yacoby »

Zini wrote:But do Morrowind.esm interior cells even have water by default? I would expect you need to set it with the SetWaterLevel instruction first.
There is a flag for interiors to indicate if they have water.
SetWaterLevel defaults to -128, even if the cell doesn't have any water. There is a patch for the game engine that does change this I think because detecting if an interior cell has water was fairly problematic (You had to use sounds).
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Water Rendering

Post by Zini »

Right. So I think the right behaviour would be to check this flag (in the CELL record). If it is unset, no water at all (we can add script functions to change that in post-1.0 development).

If it is set the water level in the CellStore data structure should be set to the default value. SetWaterLevel and GetWaterLevel are working on this value and ignore the water flag.

The renderer checks the water flag and if it is set, it renders as the hight given in the CellStore.
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Water Rendering

Post by scrawl »

According to http://www.mwmythicmods.com/argent/tech/es_format.html the WGHT (water height) record is a float, and not int. The ESM reader was reading it as int. After changing it to float I've got water showing up in interiors.

I have no clue though why only I had this problem.
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Water Rendering

Post by scrawl »

I will try to implement the script functions later today. Have I understood you correctly that we are modifying cell->data with the scripts?
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Water Rendering

Post by Zini »

Yes. Seems to be the only reasonable way to go. The water height must be stored somewhere.
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Water Rendering

Post by scrawl »

Is this ok?
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Water Rendering

Post by Zini »

Mostly. Modifying the water levels in exteriors doesn't make sense in the current implementation. I think OpSetWaterLevel and OpModWaterLevel should throw an exception when executed while in an exterior cell.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Water Rendering

Post by Zini »

Merged the water branch into master. I noticed that the water does not show up on the local map and mini map.
corristo
Posts: 495
Joined: 12 Aug 2011, 08:29

Re: Water Rendering

Post by corristo »

Code: Select all

ERROR: ESM Error: Expected subrecord WHGT but got INTV
  File: /Users/corristo/Applications/Wineskin/Morrowind.app/Contents/Resources/transgaming/c_drive/Program Files/Bethesda Softworks/Morrowind/Data Files/Morrowind.esm
  Record: CELL
  Subrecord: INTV
  Offset: 0x3531684
here is what I got
User avatar
lgromanowski
Site Admin
Posts: 1193
Joined: 05 Aug 2011, 22:21
Location: Wroclaw, Poland
Contact:

Re: Water Rendering

Post by lgromanowski »

corristo wrote:

Code: Select all

ERROR: ESM Error: Expected subrecord WHGT but got INTV
  File: /Users/corristo/Applications/Wineskin/Morrowind.app/Contents/Resources/transgaming/c_drive/Program Files/Bethesda Softworks/Morrowind/Data Files/Morrowind.esm
  Record: CELL
  Subrecord: INTV
  Offset: 0x3531684
here is what I got
I've got something similar but in different offset:
ERROR: ESM Error: Expected subrecord WHGT but got INTV
File: /home/lgromanowski/.config/openmw/Data Files/Morrowind.esm
Record: CELL
Subrecord: INTV
Offset: 0x3534334
Post Reply