SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH5 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 02-21-13, 04:00 PM   #1
THE_MASK
Ace of the deep .
 
THE_MASK's Avatar
 
Join Date: Jan 2006
Posts: 9,226
Downloads: 901
Uploads: 73


Default

Silent Hunter 5\data\Shaders\HDR\DOF_PS
Try adjusting this .
THE_MASK is offline   Reply With Quote
Old 02-21-13, 05:36 PM   #2
Dignan
Seasoned Skipper
 
Join Date: Mar 2008
Posts: 698
Downloads: 262
Uploads: 0
Default

Quote:
Originally Posted by sober View Post
Silent Hunter 5\data\Shaders\HDR\DOF_PS
Try adjusting this .
Thanks. I'm on the road now but will check it out when im back this weekend

Checked this file. This is all I see. Not sure what values to edit:

#include <data/shaders/hdr/common.inc>
float2 g_focalDistance : register(c0);

struct PS_IN
{
float2 Tex0 : TEXCOORD0;
};

float4 main( PS_IN In ) : COLOR
{
float depth = tex2D(tex1, In.Tex0).r;
float interp = saturate( abs( depth - g_focalDistance.x ) / g_focalDistance.y );

float3 color = tex2D(tex0, In.Tex0).rgb;
//return float4(depth, depth, depth, 1);
//return float4(interp, interp, interp, 1);
return float4(color, interp);
}
__________________

Last edited by Dignan; 02-23-13 at 05:34 PM.
Dignan is offline   Reply With Quote
Old 02-25-13, 03:10 PM   #3
Dignan
Seasoned Skipper
 
Join Date: Mar 2008
Posts: 698
Downloads: 262
Uploads: 0
Default

I am making some progress on this. May try to release a beta by this weekend or sooner if I have time.
__________________
Dignan is offline   Reply With Quote
Old 02-25-13, 09:25 PM   #4
Dignan
Seasoned Skipper
 
Join Date: Mar 2008
Posts: 698
Downloads: 262
Uploads: 0
Default

I'm still testing this in game but here is what I've got so far. The only side effect is that at about 50 meters you can see a faint light through the water that is the horizon. For some reason it comes through the underwater fog a bit. But how often are you looking out the periscope at that depth anyway?

If anyone is interested I can release it as a mod. I find that it looks even better when installed on top of Sh5EnvGold, the original environment mod for SH5.

This picture is underwater at high noon on a clear day.


__________________
Dignan is offline   Reply With Quote
Old 02-25-13, 09:44 PM   #5
7thSeal
Samurai Navy
 
Join Date: Mar 2010
Posts: 592
Downloads: 199
Uploads: 0
Default

Does it use impurity (stuff floating in water)? Looks like its been removed in the screenshot. High noon and clear day looks good to me in that shot. I'll certainly give it a try if you post as a mod.
7thSeal is offline   Reply With Quote
Old 02-25-13, 10:13 PM   #6
Dignan
Seasoned Skipper
 
Join Date: Mar 2008
Posts: 698
Downloads: 262
Uploads: 0
Default

Quote:
Originally Posted by 7thSeal View Post
Does it use impurity (stuff floating in water)? Looks like its been removed in the screenshot. High noon and clear day looks good to me in that shot. I'll certainly give it a try if you post as a mod.
impurities are still there. I believe it is very simple to remove them. I am indifferent towards them so I'll take them out.

One issue I am having is that the brightness of the water doesn't seem to correspond to day and night. In other words, the underwater light level looks way too light at night. It's good for daytime but doesn't look right at night. Although this was a stock issue too so nothing has changed there.
__________________
Dignan is offline   Reply With Quote
Old 02-26-13, 04:09 AM   #7
Echolot
Seasoned Skipper
 
Join Date: Mar 2010
Location: Berlin, Germany
Posts: 718
Downloads: 575
Uploads: 0
Default

To remove the underwater depth of field effect change data/Shaders/HDR/DOF_PS.fx:

Quote:
#include <data/shaders/hdr/common.inc>
float2 g_focalDistance : register(c0);

struct PS_IN
{
float2 Tex0 : TEXCOORD0;
};

float4 main( PS_IN In ) : COLOR
{
float depth = tex2D(tex1, In.Tex0).r;
float interp = saturate ( abs( depth - g_focalDistance.x ) / g_focalDistance.y ) ;

float3 color = tex2D(tex0, In.Tex0).rgb;
//return float4(depth, depth, depth, 1);
//return float4(interp, interp, interp, 1);
return float4(color, interp);
}
to:

Quote:
#include <data/shaders/hdr/common.inc>
float2 g_focalDistance : register(c0);

struct PS_IN
{
float2 Tex0 : TEXCOORD0;
};

float4 main( PS_IN In ) : COLOR
{
float depth = tex2D(tex1, In.Tex0).r;
float interp = saturate;

float3 color = tex2D(tex0, In.Tex0).rgb;
//return float4(depth, depth, depth, 1);
//return float4(interp, interp, interp, 1);
return float4(color, interp);
}
(by vickers03).

Download here.

Before



After



Regards.

Echolt.
Echolot is offline   Reply With Quote
Old 02-26-13, 06:18 PM   #8
7thSeal
Samurai Navy
 
Join Date: Mar 2010
Posts: 592
Downloads: 199
Uploads: 0
Default

Quote:
Originally Posted by Dignan View Post
impurities are still there. I believe it is very simple to remove them. I am indifferent towards them so I'll take them out.
You don't have to take them out if you don't want too, personally I use them but they can easily be removed from a mod that has them. Naights mod uses alot of impurities to help cut down the viewing distance and I've gotten use to it.

It's up to you though whether to remove them... or you could have it as an option I guess to use it.
7thSeal is offline   Reply With Quote
Old 02-26-13, 01:20 PM   #9
Hartmann
Sea Lord
 
Join Date: Mar 2005
Location: Grid CH 26, Spain ,Barcelona
Posts: 1,857
Downloads: 204
Uploads: 0
Default

Could be possible change the underwater and surface colours for anothers ?

For example if i use a environment mod with green waters and i want to turn the colour to blue.

I don´t know if is realistic but i like a lot more blue colours
__________________
But this ship can't sink!...

She is made of iron, sir. I assure you, she can. and she will. It is a mathematical certainty.

Strength and honor
Hartmann is offline   Reply With Quote
Old 02-26-13, 02:14 PM   #10
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by Dignan View Post
I'm still testing this in game but here is what I've got so far.

...

This picture is underwater at high noon on a clear day.
Considered weather and time of the day, imo the underwater visibility of your screenshot is a bit too low (at least for Mediterranean standards), yet it is a big improvement over other environmental mods.

Well done Dignan!

Quote:
Originally Posted by Dignan View Post
The only side effect is that at about 50 meters you can see a faint light through the water that is the horizon. For some reason it comes through the underwater fog a bit. But how often are you looking out the periscope at that depth anyway?
IIRC, this is an issue stoianm had faced before the first release of DynEnv, when he was trying to achieve your same effect. At the end we reluctantly decided to give up. Apparently other modders had the same problem (follow this link for another example). It seems to be related with underwater draw distances.

I hope you will manage finding the right compromise.

Quote:
Originally Posted by Dignan View Post
If anyone is interested I can release it as a mod. I find that it looks even better when installed on top of Sh5EnvGold, the original environment mod for SH5.
Definitely interested, especially if you make a version of the mod finetuned for working with DynEnv

Quote:
Originally Posted by Dignan View Post
One issue I am having is that the brightness of the water doesn't seem to correspond to day and night. In other words, the underwater light level looks way too light at night. It's good for daytime but doesn't look right at night. Although this was a stock issue too so nothing has changed there.
Try playing with the following parameters in EnvColors_*.cfg files:

UnderwaterFogColor
UnderwaterUpColor
UnderwaterUpAlpha
UnderwaterDownColor
UnderwaterDownAlpha

There is one of them for each cloud coverage type and sun angle

Quote:
Originally Posted by Echolot View Post
To remove the underwater depth of field effect change data/Shaders/HDR/DOF_PS.fx:
Interesting finding, Echolot. Thank you for sharing

Quote:
Originally Posted by Hartmann View Post
Could be possible change the underwater and surface colours for anothers ?

For example if i use a environment mod with green waters and i want to turn the colour to blue.

I don´t know if is realistic but i like a lot more blue colours
yes through EnvColors_*.cfg settings.

The advantage of using them, is that they are not global: each zone got its own cfg file. We exploited this fact in DynEnv for limiting high turpidity (greyish-greenish water surface and underwater) to some areas of the globe were algal blooms are common in real life
gap is offline   Reply With Quote
Old 02-26-13, 07:35 PM   #11
Dignan
Seasoned Skipper
 
Join Date: Mar 2008
Posts: 698
Downloads: 262
Uploads: 0
Default

Quote:
Originally Posted by gap View Post
Considered weather and time of the day, imo the underwater visibility of your screenshot is a bit too low (at least for Mediterranean standards), yet it is a big improvement over other environmental mods.
After looking at it again with fresh eyes, I sort of agree with on this. I'll reduce the fog a little and continue working on this. If I decide to venture into the world of underwater up/down color/alpha it will be a while before I complete this. It seems those parameters are the secret to making the water darker at night and lighter during the day.
__________________
Dignan is offline   Reply With Quote
Old 02-26-13, 07:56 PM   #12
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by Dignan View Post
After looking at it again with fresh eyes, I sort of agree with on this. I'll reduce the fog a little and continue working on this.
I am glad you agree with me. The low level of transparence/luminosity shown in your screenshot occur only at dusk, or in connection with overcast weather/high waves (this is always relative to Mediterranean: I have not significant experience of Atlantic diving).
Tuning down the fog effect will hopefully minimize the underwater horizon effect

Quote:
Originally Posted by Dignan View Post
If I decide to venture into the world of underwater up/down color/alpha it will be a while before I complete this. It seems those parameters are the secret to making the water darker at night and lighter during the day.
Yes, there's no other way to link undewater luminosity with season, weather and climate.

If, as I hope, you decide to make your changes over Dynamic Environment, I will provide you with as much assistance as I can
gap is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 08:13 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.