SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
02-15-19, 05:26 PM | #181 |
Admiral
|
im using 1920 x 1080
AMD RX 580 8 gig |
02-15-19, 06:17 PM | #182 |
Navy Seal
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
|
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; }; 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 |
02-15-19, 06:22 PM | #183 |
Navy Seal
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
|
|
02-15-19, 09:47 PM | #184 |
Admiral
|
I’ll play with it thanks.
|
02-15-19, 09:53 PM | #185 |
Admiral
|
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? |
02-15-19, 10:55 PM | #186 | |
Navy Seal
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
|
Thank you too!
After enabling my last patch I don't. Neither looking through bino's nor in free camera view, no matter distance/magnification levels. Quote:
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 |
|
02-15-19, 11:40 PM | #187 |
Admiral
|
@ 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! |
02-16-19, 12:12 PM | #188 | |
Navy Seal
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
|
Quote:
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? |
|
02-16-19, 12:22 PM | #189 |
Admiral
|
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!
|
02-16-19, 12:33 PM | #190 | |
Navy Seal
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
|
Quote:
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}, |
|
02-16-19, 01:40 PM | #191 |
Admiral
|
Sure thing. Give me an hour
|
02-16-19, 02:04 PM | #192 |
Admiral
|
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. |
02-16-19, 02:05 PM | #193 |
Count Dracula
|
gap my good old m8 u are still doing really amazing jobs with graphics and many more... keep up the good works cheers m8
__________________
|
02-16-19, 02:15 PM | #194 |
Village Idiot
|
Nice work Guys!
|
02-16-19, 05:02 PM | #195 |
Admiral
|
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!
|
Tags |
enviromental mod, environment, terrain, trees, vegetation |
|
|