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-15-19, 05:26 PM   #181
bstanko6
Admiral
 
Join Date: Feb 2015
Location: Murwik Naval Academy
Posts: 2,122
Downloads: 390
Uploads: 13


Default

im using 1920 x 1080

AMD RX 580 8 gig
bstanko6 is offline   Reply With Quote
Old 02-15-19, 06:17 PM   #182
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Okay, on my rig, the patch I have uploaded this afternoon fixed for good all the tiny lines; I play the game at the same resolution as you, but as I said video card and graphic settings might also play a role.

Reproducing your exact conditions would be impossible for me, so may I ask you a favour?

This is the code of the shader (ForestVS.fx) I have edited for patch 0.2.2:

Code:
float4x4 g_matWVP		: register(c0);
float3 SunLightDir		: register(c4);
float3 g_eyePos			: register(c5);

#ifdef OUTPUTDEPTH
float3	g_world			: register(c6);
#endif

struct VS_IN
{
     float4 pos		  : POSITION;                
     float3 texCoord  : TEXCOORD0;
};

struct VS_OUT
{
	float4 projPos		: POSITION;
    float2 texCoord		: TEXCOORD0;
    float4 pos			: TEXCOORD1;
};

const static float3 g_texCoords[36] = 
{
	{0,		0,  0},
	{-0.0002,	0,  1},
	
	{0.125,		0,  0},
	{0.1248,	0,  1},
	
	{0.25,		0,  0},
	{0.2498,	0,  1},
	
	{0.375,		0,  0},
	{0.3748,	0,  1},	
	
	{0.5,		0,  0},
	{0.4998,	0,  1},	
	
	{0.625,		0,  0},
	{0.6248,	0,  1},	
	
	{0.75,		0,  0},
	{0.7498,	0,  1},	
	
	{0.875,		0,  0},
	{0.8748,	0,  1},	
	
	{1,		0,  0},
	{0.9998,	0,  1},	
	
///////////////////////////

	{0,		1,  0},
	{-0.0002,	1,  1},
	
	{0.125, 	1,  0},
	{0.1248,	1,  1},
	
	{0.25,		1,  0},
	{0.2498,	1,  1},
	
	{0.375, 	1,  0},
	{0.3748,	1,  1},	
	
	{0.5,		1,  0},
	{0.4998,	1,  1},	
	
	{0.625, 	1,  0},
	{0.6248,	1,  1},	
	
	{0.75,		1,  0},
	{0.7498,	1,  1},	
	
	{0.875,		1,  0},
	{0.8748,	1,  1},	
	
	{1,		1,  0},
	{0.9998,	1,  1},	
};

static const float decompressVal = (32767.0 / 2048.0);

VS_OUT main ( VS_IN In )
{
	VS_OUT Out;
	
	const float3 up = float3(0, 1, 0);
#ifdef OUTPUTDEPTH	
	float3 viewDir	= normalize(SunLightDir - In.pos);// depth from the light's perspective - works only 

for shadow maps
#else
	float3 viewDir	= (In.pos - g_eyePos);
#endif	
	float3 right	= normalize(float3(-viewDir.z, 0, viewDir.x));//normalize(cross(viewDir, up));//
	//float3 up		= normalize(cross(right, viewDir));// this can be skipped if a top 

perspective is not allowed

	// decompress verts
	In.texCoord.x  *= 32767;
	In.texCoord.yz *= decompressVal;
	
	float3 texCoord = g_texCoords[(int)In.texCoord.x];
	
	// move position based on texture coordinates
	float3 outPos = In.pos;	
	
#ifdef OUTPUTDEPTH
	outPos += g_world;
#endif	

	outPos += right * ( (texCoord.y - 0.5f) * In.texCoord.y );
	outPos += up * ( texCoord.z * In.texCoord.z );
	
	Out.projPos  = mul(float4(outPos, 1), g_matWVP);	
	Out.texCoord = texCoord.xy;
	Out.pos.xyz	 = In.pos.xyz;
	Out.pos.w = Out.projPos.z;
	
	return Out;
};
You should open the same shader on your computer (you can use notepad for that) and replace the decimal numbers I have marked above in red with some smaller numbers.

Maybe you could start by using the same values on top of each red number (0, 0.125, 0.250, etc.) minus 0.001.

- If that is not enough, use even smaller numbers;

- if it works, use bigger values but still smaller that the ones I used for my patch.

- keep increasing/decreasing those numbers until you find the values closest to my settings that fix the lines issue for you.

I might have explained myself poorly, so don't hesitate asking in case you need further explanations
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 02-15-19, 06:22 PM   #183
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by propbeanie View Post


That's it!
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 02-15-19, 09:47 PM   #184
bstanko6
Admiral
 
Join Date: Feb 2015
Location: Murwik Naval Academy
Posts: 2,122
Downloads: 390
Uploads: 13


Default

I’ll play with it thanks.
bstanko6 is offline   Reply With Quote
Old 02-15-19, 09:53 PM   #185
bstanko6
Admiral
 
Join Date: Feb 2015
Location: Murwik Naval Academy
Posts: 2,122
Downloads: 390
Uploads: 13


Default

Are you saying you don’t see lines on your pc?

If not, what on my graphics card would cause that? I would have no clue?
bstanko6 is offline   Reply With Quote
Old 02-15-19, 10:55 PM   #186
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by bstanko6 View Post
I’ll play with it thanks.
Thank you too!

Quote:
Originally Posted by bstanko6 View Post
Are you saying you don’t see lines on your pc?
After enabling my last patch I don't. Neither looking through bino's nor in free camera view, no matter distance/magnification levels.

Quote:
Originally Posted by bstanko6 View Post
If not, what on my graphics card would cause that? I would have no clue?
Well, that might require a long explanation.

For each terrain type, eight trees are stacked one on top of the other in the same texture. Where one tree ends, the next tree starts. In theory the demarcation between a tree and the next one should be sharp, but in practice some blending happens in game. The lines you see on top of the trees, are actually a tiny portion of stem of other trees.

On my computer, this blending mostly happened when I looked at trees from very close range (that's why I thought that the glitch could be ignored); what I did with my patch was "clipping" the very top of each tree, thus removing the lines blended on it.
Nnetheless, I think that in your case the problem comes from the mipmaps; that might explain the fact that you only see those tiny lines when you look at trees from a certain distance. Mipmaps are calculated automatically and, depending on the resampling method used, some shading happens. That worsens the in-game blending, making the lines you see at long range, thicker than they were on my computer. The shading is so faint, that the shaded lines are considered transparent by my video card, but not by your one. The difference might be caused by a bunch of factors, but I think making a comparison between different gfx cards would be a waste of time.
What matters here is finding a compromise that will work with all the cards.

One solution could be re-saving my textures, but using a sharper re-sampling method, or editing the contrast of their alpha (opacity) channels so that a bigger portion of them will result black (=transparent). This approach would have two con's though: each terrain type features four tree textures (one per season); multiply this number times three (one main resolution plus two optional resolutions), times six (number of vegetation/terrain types I have modelled so far), that makes 72 textures that I would need to edit. Moreover, a sharper opacity mask might mean a poorer texture quality, especially for the smaller mipmaps.

The other fix is "cutting" a bigger portion of texture from the top of each tree. Which is exactly what I asked you to test. I am sorry, but since I don't have your same glitch, I need your help for fixing it
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 02-15-19, 11:40 PM   #187
bstanko6
Admiral
 
Join Date: Feb 2015
Location: Murwik Naval Academy
Posts: 2,122
Downloads: 390
Uploads: 13


Default

@ Gap I did it my friend no problem now. Here are the numbers:

const static float3 g_texCoords[36] =
{
{0, 0, 0},
{-0.0001, 0, 1},

{0.125, 0, 0},
{0.1230, 0, 1},

{0.25, 0, 0},
{0.2490, 0, 1},

{0.375, 0, 0},
{0.3730, 0, 1},

{0.5, 0, 0},
{0.4980, 0, 1},

{0.625, 0, 0},
{0.6230, 0, 1},

{0.75, 0, 0},
{0.7480, 0, 1},

{0.875, 0, 0},
{0.8730, 0, 1},

{1, 0, 0},
{0.9980, 0, 1},

///////////////////////////

{0, 1, 0},
{-0.0001, 1, 1},

{0.125, 1, 0},
{0.1240, 1, 1},

{0.25, 1, 0},
{0.2480, 1, 1},

{0.375, 1, 0},
{0.3730, 1, 1},

{0.5, 1, 0},
{0.4980, 1, 1},

{0.625, 1, 0},
{0.6230, 1, 1},

{0.75, 1, 0},
{0.7480, 1, 1},

{0.875, 1, 0},
{0.8730, 1, 1},

{1, 1, 0},
{0.9980, 1, 1},

Perfect for us AMD users! I never played with shaders before. Thanks!
bstanko6 is offline   Reply With Quote
Old 02-16-19, 12:12 PM   #188
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by bstanko6 View Post
@ Gap I did it my friend no problem now. Here are the numbers:

 
const static float3 g_texCoords[36] =
{
{0, 0, 0},
{-0.0001, 0, 1},

{0.125, 0, 0},
{0.1230, 0, 1},

{0.25, 0, 0},
{0.2490, 0, 1},

{0.375, 0, 0},
{0.3730, 0, 1},

{0.5, 0, 0},
{0.4980, 0, 1},

{0.625, 0, 0},
{0.6230, 0, 1},

{0.75, 0, 0},
{0.7480, 0, 1},

{0.875, 0, 0},
{0.8730, 0, 1},

{1, 0, 0},
{0.9980, 0, 1},

///////////////////////////

{0, 1, 0},
{-0.0001, 1, 1},

{0.125, 1, 0},
{0.1240, 1, 1},

{0.25, 1, 0},
{0.2480, 1, 1},

{0.375, 1, 0},
{0.3730, 1, 1},

{0.5, 1, 0},
{0.4980, 1, 1},

{0.625, 1, 0},
{0.6230, 1, 1},

{0.75, 1, 0},
{0.7480, 1, 1},

{0.875, 1, 0},
{0.8730, 1, 1},

{1, 1, 0},
{0.9980, 1, 1},


Perfect for us AMD users! I never played with shaders before. Thanks!
Thank you very much bstanko6, well done!

I have noticed that you didn't subtract a constant vale from stock vertex coordinates (e.g. 0.125 - 0.123 = 0.002, but 0.25 - 0.249 = 0.001). Is there a reason for that? At the first attempt, did you try doing as I had said yesterday?

Quote:
Originally Posted by gap View Post
Maybe you could start by using the same values on top of each red number (0, 0.125, 0.250, etc.) minus 0.001.
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 02-16-19, 12:22 PM   #189
bstanko6
Admiral
 
Join Date: Feb 2015
Location: Murwik Naval Academy
Posts: 2,122
Downloads: 390
Uploads: 13


Default

Exactly! I’m not too good at playing with programs and stuff so I stay simple and do little changes at a time. So went the red numbers you suggested and changed them ever so slightly but consistently. I hope you can publish this as a fix for those that have similar issues like I did. Now it’s absolutey perfect! I tried several times in several testing missions!
bstanko6 is offline   Reply With Quote
Old 02-16-19, 12:33 PM   #190
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by bstanko6 View Post
Exactly! I’m not too good at playing with programs and stuff so I stay simple and do little changes at a time. So went the red numbers you suggested and changed them ever so slightly but consistently. I hope you can publish this as a fix for those that have similar issues like I did. Now it’s absolutey perfect! I tried several times in several testing missions!
Adding the fix to the next EcoMod version is exactly my intention, and you deserved a special mention in its release noted, but before we release the fix, could you please test the numbers below?

Code:
{0,	0, 0},
{-0.001,	0, 1},

{0.125,	0, 0},
{0.124,	0, 1},

{0.25,	0, 0},
{0.249,	0, 1},

{0.375,	0, 0},
{0.374,	0, 1},	

{0.5,	0, 0},
{0.499,	0, 1},	

{0.625,	0, 0},
{0.624,	0, 1},	

{0.75,	0, 0},
{0.749,	0, 1},	

{0.875,	0, 0},
{0.874,	0, 1},	

{1,	0, 0},
{0.999,	0, 1},	

///////////////////////////

{0,	1, 0},
{-0.001,	1, 1},

{0.125, 1, 0},
{0.124,	1, 1},

{0.25,	1, 0},
{0.249,	1, 1},

{0.375, 1, 0},
{0.374,	1, 1},	

{0.5,	1, 0},
{0.499,	1, 1},	

{0.625, 1, 0},
{0.624,	1, 1},	

{0.75,	1, 0},
{0.749,	1, 1},	

{0.875,	1, 0},
{0.874,	1, 1},	

{1,	1, 0},
{0.999,	1, 1},
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 02-16-19, 01:40 PM   #191
bstanko6
Admiral
 
Join Date: Feb 2015
Location: Murwik Naval Academy
Posts: 2,122
Downloads: 390
Uploads: 13


Default

Sure thing. Give me an hour
bstanko6 is offline   Reply With Quote
Old 02-16-19, 02:04 PM   #192
bstanko6
Admiral
 
Join Date: Feb 2015
Location: Murwik Naval Academy
Posts: 2,122
Downloads: 390
Uploads: 13


Default

testing completed with your numbers and it is exactly the same, or at least no change.

Tested all Gap testing missions with all seasons - successful.

Changed weather, for more ship movement, and sighted no black lines - successful.

Looks great, and I will just keep your new numbers for the Eco patch. Good Job friend.
bstanko6 is offline   Reply With Quote
Old 02-16-19, 02:05 PM   #193
Sjizzle
Count Dracula
 
Sjizzle's Avatar
 
Join Date: Aug 2012
Location: 46°13′N, 24°47′E
Posts: 1,816
Downloads: 405
Uploads: 0


Default

gap my good old m8 u are still doing really amazing jobs with graphics and many more... keep up the good works cheers m8
Sjizzle is offline   Reply With Quote
Old 02-16-19, 02:15 PM   #194
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,319
Downloads: 130
Uploads: 0


Default

Nice work Guys!
__________________
I don't do Stupid. So don't ask.
Jeff-Groves is offline   Reply With Quote
Old 02-16-19, 05:02 PM   #195
bstanko6
Admiral
 
Join Date: Feb 2015
Location: Murwik Naval Academy
Posts: 2,122
Downloads: 390
Uploads: 13


Default

Thank Gap! He has nice work. I was privileged to help test. It’s a fantastic mod. I have never been one about harbors or the way they looked before, but leaving the harbor and seeing these real trees looks really incredible! And the proper seasonal colors makes it even better!
bstanko6 is offline   Reply With Quote
Reply

Tags
enviromental mod, environment, terrain, trees, vegetation


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 04:45 PM.


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