Jump to content

Working on a better water.fx shader for MGE XE


Daemonjax

Recommended Posts

Featuring shoreline foam based on Abot's work (but heavily modified) among other user configurable options.

 

It's not done yet, but I'm making progress. I should be mostly done like tomorrow or something, and I'll see about making it available for download somewhere:

 

 

Morrowind%202015-07-10%2023.49.58.720.pn

 

 

 

Morrowind%202015-07-10%2023.51.55.724.pn

 

 

EDIT: Updated dropbox link since I noticed they all broke over the years: https://www.dropbox.com/sh/n5e9lobjgj0n8so/AADdZO-DSUc-LHbYxd_8UNSxa?dl=0

Edited by Daemonjax
Link to comment
Share on other sites

Ok, so I solved the last problem I needed to solve (reduction of specular highlights on foam as shown in this screenshot):

 

 

Morrowind%202015-07-15%2002.18.40.594.pn

 

 

Just going to do a code cleanup then post the download links.

 

EDIT: Download link: https://dl.dropboxusercontent.com/u/32777109/Mods/Morrowind/shaders/XE%20Water.fx

 

I should probably make a video.

 

EDIT2:

 

Youtube video link:

 

https://youtu.be/Ai_FmTyQnGc

Edited by Daemonjax
Link to comment
Share on other sites

This looks yum.

 

Took the liberty of posting about this in the MGE XE thread over at Bethsoft.

 

Cool.

 

I was going to make an account an post this over there, but: I noticed every single thread I was interested in reading and responding to was locked by moderators... which kinda turns me off.

 

EDIT: Just tried to create an account to post in the thread you linked, but I can't figure out how to get past the zenimax privacy agreement.

 

EDIT2: Ok, I can magically get to the account creation screen but it says my account already exists, and when I try to reset the password for it I get the "oops something went wrong screen". I give up on those forums.

 

Anyways, I made a few changes to the shader throughout the day without realizing anyone took notice... still the same download link... gotta love dropbox.

Edited by Daemonjax
Link to comment
Share on other sites

 

<snip>

Thoughts?

Er... that looks fantastic :thumbsup:

 

Sadly, no constructive criticism here

 

 

I think:

 

1) the foam should be slightly whiter during the day, but I had to think about how best to do it while preserving the perceived lumen value of the existing color -- so whiter but not any brighter (there's a difference). I've made a decision, and will update this post once the change is implemented. I'm happy enough with how foam looks at night and I think that's in part due to it being whiter (the color is based entirely on SunCol at night, which is a very pale color by default at night), so it better maintains the illusion of being foam? Not sure. I don't want to just ditch SkyCol from the day color calculation, though... that would feel artificial.

 

2) when water tinting is enabled, water color should be whiter, brighter, and possibly more reflective (just to grab more grey from the sky) in the foggy weather climate to maintain the illusion of fog rising off the water. I purposefully didn't include sky color in the water tint color calculation because SkyCol is not exposed in mge xe for custom shaders (specifically the one for underwater effects). I'm working on an underwater shader that will match the water tint the user chose in water.fx as accurately as possible. That would be impossible if SkyCol was used in above-ground calculation, but I may be able to work something in under these circumstances. It's harder than I thought it would be due to engine limitations (namely I have to work with an original image that looks terrible underwater -- I can only polish a turd so much). What I have done so far for the underwater shader looks photo-realistic under certain conditions, but not good at all in others.

 

3) The optional sewer waves should look more like the ripple effects created by player movement through water, because right now it doesn't look good enough to actually use (imo).

 

My hope is that someone takes this code an improves on it, or at the very least finds better settings via defined values, because (and I'm not ashamed to say it) I'm nearing the limit of my capability.

 

UPDATE: Addressed point #1 with the following defines:

 

#define USE_FOAM_DYNAMIC_BRIGHTNESS_WHITER  // (optional) makes foam whiter during the day, without significantly changing brightness. 
          #define FOAM_DYNAMIC_BRIGHTNESS_WHITER_MUL  0.33 // [0.1, 1.0] at 1.00, foam will be 100% white during the day (but will otherwise retain the same brightness level).
Edited by Daemonjax
Link to comment
Share on other sites

  • 1 month later...

Great work! However... I would like to have border "under" the foam little bit darker. What line should I change? Thanks!

 

Screenshot for better know, what I'm talking about...

 

http://i3.minus.com/ibfAEpCibSMso3.jpg

Edited by Shumafuk
Link to comment
Share on other sites

Lowering both FOAM_FRONT_BRIGHTNESS and FOAM_BACK_BRIGHTNESS should do what you want.

 

Lowing FOAM_BRIGHTNESS would also lower the brightness of the animated foam texture, which I think you want to keep the way it is... if I understand the question properly.

 

I think it might be easier in the long run for you to do something like this (let the shader compiler do some of the work for you and only change FOAM_FRONT_BACK_BRIGHTNESS yourself):

 

change the lines:

    #define FOAM_BRIGHTNESS                    1.00                                       // [0.5, 2.0] ; this is used here only for convenience 
    #define FOAM_TEXTURE_BRIGHTNESS  0.50 * FOAM_BRIGHTNESS  // 0.5 specifically the foam texture brightness
    #define FOAM_FRONT_BRIGHTNESS      0.75 * FOAM_BRIGHTNESS // 0.75 front of wave foam (kinda): foam * foam * FOAM_FRONT_BRIGHTNESS
    #define FOAM_BACK_BRIGHTNESS         0.25 * FOAM_BRIGHTNESS // 0.25 rear of wave foam (kinda): sqrt(foam) * FOAM_BACK_BRIGHTNESS   

... to:

     #define FOAM_BRIGHTNESS                          1.00         // [0.5, 2.0] ; this is used here only for convenience
     #define FOAM_FRONT_BACK_BRIGHTNESS 0.50 // [0, 1.0] ; this is used here only for convenience for Shumafuk
     #define FOAM_TEXTURE_BRIGHTNESS        0.50 * FOAM_BRIGHTNESS // 0.5 specifically the foam texture brightness
     #define FOAM_FRONT_BRIGHTNESS            0.75 * FOAM_BRIGHTNESS * FOAM_FRONT_BACK_BRIGHTNESS // 0.75 front of wave foam (kinda): foam * foam * FOAM_FRONT_BRIGHTNESS
     #define FOAM_BACK_BRIGHTNESS               0.25 * FOAM_BRIGHTNESS * FOAM_FRONT_BACK_BRIGHTNESS // 0.25 rear of wave foam (kinda): sqrt(foam) * FOAM_BACK_BRIGHTNESS   

Let us know what settings you come up with. Maybe yours look better than mine! That's why I included so many #defines for people to play with.

 

Note: Since how the foam looks depends on so many factors (including viewing angle), I don't think there's one setting that looks "best" everywhere under all conditions -- even after taking into consideration that what looks "best" is certainly subjective to some extent.

 

Any other feedback/constructive criticism would be cool, as well.

Edited by Daemonjax
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...