[RELz] Improved water shader for MGE 3.8 v0.6

Post » Sat Aug 28, 2010 10:32 am

NOTE: This water shader will not work with MGE beta rev161 (i think) or higher. Instead, it is included in the official MGE beta releases since rev.161.
If you use MGE beta rev161 or higher, do not use this shader. Instead, use the original InGame.fx and select Shader Model 3.0 in the 'Distant Land' tab in MGEgui.

-----

Since the http://www.gamesas.com/bgsforums/index.php?showtopic=979357 nearly reached post limit, I decided to start a new one.

With MGE rev118 released, I can finally release the new version 0.6 of my water shader. :)

Screenshots and Download available on http://www.tesnexus.com/downloads/file.php?id=23606.

This version requires MGE 3.8 rev118! The newest MGE beta builds can be downloaded http://sourceforge.net/project/showfiles.php?group_id=239453&package_id=311044&release_id=662707.

EDIT:
Version 0.6a is up. Changes:

- Reworked underwater surface shader
- Increased water turbidity
- Implemented a more accurate approximation for the Fresnel term
- Slightly increased water opacity
- Includes an underwater effects postprocessing shader


You can now edit the 'InGame.fx' to toggle blurred reflections, adjust the caustic lighting strength, and enable a new, more realistic fogging method. More details in the readme.txt file and in the InGame.fx file itself. :)

When using the new fogging method, there are some things you need to take care of, otherwise there will be slight graphical issues:
- Your distant land draw distance should be about 4 or 5 times as large as your fog range. With the exponential fog your actual view range is higher than your fog range. To prevent popping in of distant land you will need to set the draw distance higher.
- You should make sure that your fog range always stays above the rendering range of distant statics, otherwise statics will pop in. You may also have to edit your weather settings in the 'distant land' tab and adust the fog range for specific weather types.

That's pretty much all. I will also release a version with real water waves soon. This will require a modified d3d8.dll though.
User avatar
Anthony Diaz
 
Posts: 3474
Joined: Thu Aug 09, 2007 11:24 pm

Post » Sat Aug 28, 2010 3:56 pm

First to download and comment, yuss! But in all seriousness, dude, I am blown away, the game looks stunning with your water. Keep it up! :tops:
User avatar
sam westover
 
Posts: 3420
Joined: Sun Jun 10, 2007 2:00 pm

Post » Sat Aug 28, 2010 11:06 am

Hhhhmmm, i'm having issues with 118, atm, nothing seems to render, I mean, view distance is fine, but statics don't seem to be rendering for me, I'm gonna play around with it untill I can get it to work properly so I can give feedback on water reflections ect...
User avatar
Devin Sluis
 
Posts: 3389
Joined: Wed Oct 24, 2007 4:22 am

Post » Sun Aug 29, 2010 12:47 am

Fantastic! Downloading & diving :)
User avatar
Riky Carrasco
 
Posts: 3429
Joined: Tue Nov 06, 2007 12:17 am

Post » Sat Aug 28, 2010 10:36 am

I love it, though I have three small issues/notes(very small to be honest).

Caustics look incredible, but I am sad that they don't appear while underwater, as I feel it would greatly add to the effect.

Sky reflections seem toned down, they are still there, but they just are less noticable, which strikes me as a bit odd.

SSAO does not seem to account for the new fog algorithm which leads to odd outlines in the distance, however, my game is faster without SSAO using this new improved fogging, then it was with SSAO and old crappy fogging, so I'll take the new fog over SSAO anyway. :P

Regardless of those (can't stress this enough) very small issues, this is the most beautiful water I've seen to date (not to mention how much better the fog is)...in any game :foodndrink: , now, if you could only find a way to have both waves and caustics........... :hubbahubba: :bolt:
User avatar
Spencey!
 
Posts: 3221
Joined: Thu Aug 17, 2006 12:18 am

Post » Sat Aug 28, 2010 1:50 pm

Yay, new phal waters! I wish I had the time to check it out in-game, but the screenshots look very promising, as always! :)
User avatar
Rob
 
Posts: 3448
Joined: Fri Jul 13, 2007 12:26 am

Post » Sat Aug 28, 2010 9:28 pm

Wow, i found this water really nice but, (always there are a 'but' lol), my last frontier is to know how can i make this water not so transparent?. In the Balmora river its difficult to me know if there are water or the river is dry because its nearly transparent in all the distance. Only the waves break this in some light conditions. Can I change that in the fog settings? I changed some things without any luck.
Another question: It is possible to add a shader to see the caustics when underwater?
Thanks for this work Phal :icecream:
User avatar
Jhenna lee Lizama
 
Posts: 3344
Joined: Wed Jun 06, 2007 5:39 am

Post » Sat Aug 28, 2010 12:11 pm

Wow, i found this water really nice but, (always there are a 'but' lol), my last frontier is to know how can i make this water not so transparent?. In the Balmora river its difficult to me know if there are water or the river is dry because its nearly transparent in all the distance. Only the waves break this in some light conditions. Can I change that in the fog settings? I changed some things without any luck.
Another question: It is possible to add a shader to see the caustics when underwater?
Thanks for this work Phal :icecream:

You could try editing the following line in the InGame.fx file:
fresnel = pow(saturate(fresnel),5);

And change the 5 to something lower (1 as minimum). This will make reflections more apparent, while decreasing translucency. Even though 5 is a 'realistic' value ;)
As a matter of fact, with the new revision it is possible to add caustics underwater. I will try writing a shader for it :)



@matilija
Sky reflections are toned down, because reflections were toned down in general. But Morrowind renders clouds not down to the horizon, and fades out clouds at a rather high view angle. The reflections on the oher hand are strongest at very low view angle, so you will end up seeing clouds reflected very rarely. You could try to add the same changes to the ingame.fx file as above to make reflections more apparent. Sometimes the most realistic solution does not look best ;)

The SSAO shader uses the old fog algorithm. To make it 100% compatible with the exponential fog, you have to change the line
float fog = saturate((dist - fogstart) / (fogrange - fogstart));
to
float fog = 1 - saturate( exp(-(dist-ExpFogStart)/(ExpFogRangeMinusStart)) ) * ExpFogMult;

And you need to add the following lines:
static const float ExpFogStart = max(0, fogstart);static const float ExpFogMult = saturate( fogrange/(fogrange-fogstart) );static const float ExpFogRangeMinusStart = fogrange - ExpFogStart;
These should be placed before the line
float4 combine(float2 tex : TEXCOORD0) : COLOR


EDIT2: fixed the code for the SSAO fog
User avatar
Jeff Tingler
 
Posts: 3609
Joined: Sat Oct 13, 2007 7:55 pm

Post » Sat Aug 28, 2010 10:52 pm

I have a very strange bug - my water turns out to be multicolored, it is constantly blinking and the waves are very slow...
Here is the http://i626.photobucket.com/albums/tt346/rhymer1987/MGEScreenshot174.jpg
User avatar
lisa nuttall
 
Posts: 3277
Joined: Tue Jun 20, 2006 1:33 pm

Post » Sat Aug 28, 2010 3:34 pm

You could try editing the following line in the InGame.fx file:
fresnel = pow(saturate(fresnel),5);


^^there are 2 lines like this.....should I change both?

As a matter of fact, with the new revision it is possible to add caustics underwater. I will try writing a shader for it :)


:D Hottness

The SSAO shader uses the old fog algorithm. To make it 100% compatible with the exponential fog, you have to change the line
float fog = saturate((dist - fogstart) / (fogrange - fogstart));


Do you mean this line?
float fog = saturate( ( FogRange - dist ) / (FogRangeMinusStart)


to
float fog = saturate(exp( -dist/(fogrange - fogstart) ));



Thanks for all of your help btw! :D
User avatar
alyssa ALYSSA
 
Posts: 3382
Joined: Mon Sep 25, 2006 8:36 pm

Post » Sat Aug 28, 2010 10:31 am

I have a very strange bug - my water turns out to be multicolored, it is constantly blinking and the waves are very slow...
Here is the http://i626.photobucket.com/albums/tt346/rhymer1987/MGEScreenshot174.jpg

Are you sure you have MGE SVN rev 118 installed? This bug happens when using this water shader with earlier versions.


@matilija:
Yep, both lines need to be changed.
For the SSAO fog, you need to edit the SSAO shader file, not the ingame.fx file ;)
I just edited my last post, I forgot something in the code line before.


Oh and btw: http://img230.imageshack.us/img230/551/zscreenshot14.jpg. The shader worked right away :D
http://www.speedyshare.com/126687794.html.
User avatar
Pants
 
Posts: 3440
Joined: Tue Jun 27, 2006 4:34 am

Post » Sat Aug 28, 2010 7:46 pm

Are you sure you have MGE SVN rev 118 installed? This bug happens when using this water shader with earlier versions.


@matilija:
Yep, both lines need to be changed.
For the SSAO fog, you need to edit the SSAO shader file, not the ingame.fx file ;)
I just edited my last post, I forgot something in the code line before.


Oh and btw: http://img230.imageshack.us/img230/551/zscreenshot14.jpg. The shader worked right away :D
http://www.speedyshare.com/126687794.html.



Very very cool, thanks Phal! :celebration:
User avatar
Tai Scott
 
Posts: 3446
Joined: Sat Jan 20, 2007 6:58 pm

Post » Sat Aug 28, 2010 1:37 pm

Oh and btw: http://img230.imageshack.us/img230/551/zscreenshot14.jpg. The shader worked right away :D
http://www.speedyshare.com/126687794.html.



Fast as the wind?? The deeps of the sea of ghost now looks superb?? Makes a huge difference. Thanks
User avatar
brian adkins
 
Posts: 3452
Joined: Mon Oct 01, 2007 8:51 am

Post » Sat Aug 28, 2010 8:42 pm

Last time I tried to use rev118 like a week ago or less, I couldn't get truebloom to work because I needed to use a fixed .dll that didn't work with 118 back then (as far as I could get to working it, anyway!). Does rev118 come with the 'new .dll' now or... what? Does anyone have any advice for me? I'd like to use this shader, but I don't want to install rev118 until I'm certain of what to do when I get there because last time it gave me a headache.
User avatar
BlackaneseB
 
Posts: 3431
Joined: Sat Sep 23, 2006 1:21 am

Post » Sat Aug 28, 2010 11:20 am

This looks AMAZING above water!
http://img84.imageshack.us/img84/9563/mgescreenshot010.jpg

However, underwater may be a bit of a different story... the underwater caustics looks great, but other stuff seems a bit... off.
even with your fog fix, ssao is still acting weird underwater, and bleeding through on some objects that it seems it shouldn't.
Also, the water surface is almost completely opaque underwater... Wasn't it more translucent in an older version, or was that the other guy's shader? Anywho, it is definitely something that would move this shader from OMGWTFBBQ to OMGWTBQ!!!1111ELEVEN
http://img180.imageshack.us/img180/8117/mgescreenshot008.jpg
http://img84.imageshack.us/img84/3350/mgescreenshot009.jpg


edit: also, what would you recommend as companion ini settings for your water? :D

edit2: nevermind, the underwater surface was a weird fog bug... gotta play with the settings.
User avatar
Lizs
 
Posts: 3497
Joined: Mon Jul 17, 2006 11:45 pm

Post » Sat Aug 28, 2010 2:12 pm

Killer phal, absolutely killer. Congratulations on the release, this looks great!

EDIT: Well, I tested it out. I'm not sure how exponential fog is supposed to work or what it's supposed to look like - is it at all associated with those hazy screenshots you previously posted? And I'm unsure if this water looks much better than the last. I feel like you almost perfected water with v5 - feels like at this point it's come down to preference. And by the way Phal - you've created some of the best looking water I've ever seen in a videogame. Almost tops Crysis.
User avatar
amhain
 
Posts: 3506
Joined: Sun Jan 07, 2007 12:31 pm

Post » Sat Aug 28, 2010 4:13 pm

Thanks for this, phal :thumbsup:
Last time I tried to use rev118 like a week ago or less, I couldn't get truebloom to work because I needed to use a fixed .dll that didn't work with 118 back then (as far as I could get to working it, anyway!). Does rev118 come with the 'new .dll' now or... what? Does anyone have any advice for me? I'd like to use this shader, but I don't want to install rev118 until I'm certain of what to do when I get there because last time it gave me a headache.
rev118 han't been out http://sourceforge.net/projects/morrgraphext/files/SVN%20Builds/MGE%203.8%20SVN%20build/, AFAIK all of phal's tweaks to the DLL are included. Current notes I've made on rev118:
  • MGE.ini should be removed from the package. Delete from the 7zip file or extract to a temporary location and delete MGE.ini before copying it into your Morrowind directory.
  • There seems to be a file missing in the package, though, which causes the 'Unable to create the required textures' error in the shader preview. To fix that, you will need to create a bitmap image file called 'depth.bmp' in the mge3 folder. The 'preview.bmp' image in this folder is the default and image.
  • The distant blur setting in MGE gui will make all distant statics as well as water disappear. You will need to disable distant blur to make it work.
Think there's a fix for that last one in the MGE thread.
User avatar
Guy Pearce
 
Posts: 3499
Joined: Sun May 20, 2007 3:08 pm

Post » Sat Aug 28, 2010 12:46 pm

Thanks for this, phal :thumbsup:
rev118 han't been out http://sourceforge.net/projects/morrgraphext/files/SVN%20Builds/MGE%203.8%20SVN%20build/, AFAIK all of phal's tweaks to the DLL are included.
Maybe I'm just insane, then.
User avatar
Fluffer
 
Posts: 3489
Joined: Thu Jul 05, 2007 6:29 am

Post » Sun Aug 29, 2010 12:06 am

Maybe I'm just insane, then.

there was a rev 118 SHADER pack out for a couple weeks, but the rev 118 full package (new exe, dll, etc) just came out yesterday

anyway now that I made more tweaks to the distantland tab settings, I love this even more :D
Now to play with the ini settings to make it darker underwater....

edit: There is one problem I see.... current bloom shaders destroy the new fog :(
User avatar
willow
 
Posts: 3414
Joined: Wed Jul 26, 2006 9:43 pm

Post » Sat Aug 28, 2010 12:13 pm

Hi -

The new water looks great. Your improved underwater caustics shader causes all splash screens and the menu background image not to render on my system -- pure black!

Thanks for all of your work on this.
User avatar
Myles
 
Posts: 3341
Joined: Sun Oct 21, 2007 12:52 pm

Post » Sat Aug 28, 2010 2:07 pm

Hi -

The new water looks great. Your improved underwater caustics shader causes all splash screens and the menu background image not to render on my system -- pure black!

Thanks for all of your work on this.

I had that issue as well, then I moved the Underwater Shader to be the last in my listing:

(My List)
DX9 HLSL HDR 3
sunshaft_v001a
Improved Water Caustics

Now everything loads fine :)
User avatar
ANaIs GRelot
 
Posts: 3401
Joined: Tue Dec 12, 2006 6:19 pm

Post » Sun Aug 29, 2010 1:04 am

With the ImprovedWaterCaustics file, I assume that we put that in with the InGame fx file?
User avatar
Floor Punch
 
Posts: 3568
Joined: Tue May 29, 2007 7:18 am

Post » Sat Aug 28, 2010 3:26 pm

Hmm I'm actually at a loss... can't find what to change to make my ambient light settings affect underwater more (right now I have really dark nights but its pretty bright udnerwater :( )

With the ImprovedWaterCaustics file, I assume that we put that in with the InGame fx file?

nope, save it in your default shaders directory and load it like you would bloom or hdr.
User avatar
Jessica Thomson
 
Posts: 3337
Joined: Fri Jul 21, 2006 5:10 am

Post » Sat Aug 28, 2010 1:50 pm

I had that issue as well, then I moved the Underwater Shader to be the last in my listing:

(My List)
DX9 HLSL HDR 3
sunshaft_v001a
Improved Water Caustics

Now everything loads fine :)


Thanks for the suggestion, just getting it out of the top slot worked.
User avatar
Camden Unglesbee
 
Posts: 3467
Joined: Wed Aug 15, 2007 8:30 am

Post » Sat Aug 28, 2010 11:55 pm

I dragged the whole folder to my morrowind folder and it showed up so crisis averted. Now i think i will study vtastek's video on putting mods onto morrowind.

It works quite good for me. No problems at all. And I like all improvements. Toned down reflections(esp. sky), new fog and caustics. It is so realistic now. (I am sure wavy will be more realistic.) But x4 multiplier is a FPS killer. I suggest introducing some real LOD for distant to balance it if it is possible. Like the LOD for wavy water.

I got some bright underwater fog too, then I changed fog numbers, and it is good now. Below water fog end is 0.7 now. But I am still tweaking... You have to tweak numbers for all weather types.

And underwater caustics is a post process shader, I am sure you noticed. I put it right after SSAO. And it is revolutionary, now I think I can launch new shader WIPs based on that shader's techniques.
User avatar
Lisa
 
Posts: 3473
Joined: Thu Jul 13, 2006 3:57 am

Next

Return to III - Morrowind