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 01-18-19, 04:36 PM   #76
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
Default

Quick update on terrain object's LOD issue

As expected, the MinRenderDim controller does nothing on GR2 object, but there is more: wanting to discover what made LOD ranges too short for my sea stack model, I created a copy of one of the stock objects with the longest ranges, and I imported my model into it.

I supposed LOD ranges to be governed by some little know or hidden parameter in mesh's extended data, and I hoped that after switching to a GR2 file with the appropriate ExtendedData settings my model would have been visible from further away, but unfortunately I was wrong and, at close distance, the model was popping in and out as I moved closer of further away from it.

The next step was copying the same (stock) GR2 file used in my previous test, and using it in place of the sea stack without further changes. Result: I could see the model (a group of buildings) from a long distance with no sudden "pop up effect".

At this point I started thinking that LOD distances could be ID/bone name related and that by renaming the bones I could have made the game not to recognize my object as a proper terrain object. To check that I imported the sea stack mesh in the same file as before without changing bone names, but again LOD ranges were too short. That excluded bone names from my list of suspects and it left me with just one reasonable hypothesis LOD ranges are mesh-related. To confirm that, I re-imported the original (stock) mesh in the file of my tests and, in accordance with my last statement, the object was visible again from a long distance.

What can tie meshes and LOD distances? There must be an obvious link, but I am missing it
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 01-18-19, 04:49 PM   #77
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,425
Downloads: 131
Uploads: 0


Default

Can you post pics of what your talking about?
Jeff-Groves is offline   Reply With Quote
Old 01-18-19, 06:37 PM   #78
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by Jeff-Groves View Post
Can you post pics of what your talking about?
Please check your e-amail: I sent you a copy of my working files and a description of them. I hope that by reproducing the issue on your machine and by looking directly into the files, you will make yourself a better idea on the issue than you could get from simple screenshots
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 01-19-19, 11:55 AM   #79
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,425
Downloads: 131
Uploads: 0


Default

OK. I see what you are talking about now.
Try changing the collision mesh with the one the city GR2 has.
I'd do it but I'm not home and don't have all the needed programs with me.


If that solves the issue create a new collision mesh with a broad base but deep enough to not hit a sub or ship in the area.
I'm looking out the window of my temporary apartment in Cleveland, Ohio right now.


All that view needs is a VIIA in the river. LOL

Last edited by Jeff-Groves; 01-19-19 at 12:15 PM.
Jeff-Groves is offline   Reply With Quote
Old 01-19-19, 01:06 PM   #80
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by Jeff-Groves View Post
OK. I see what you are talking about now.
Try changing the collision mesh with the one the city GR2 has.
I'd do it but I'm not home and don't have all the needed programs with me.


If that solves the issue create a new collision mesh with a broad base but deep enough to not hit a sub or ship in the area.
I think I've got your point, I will do that and I will let you know if it works

Quote:
Originally Posted by Jeff-Groves View Post
I'm looking out the window of my temporary apartment in Cleveland, Ohio right now.


All that view needs is a VIIA in the river. LOL
So nice! I wish we had a SH Great Lakes campaign lol
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 01-19-19, 04:22 PM   #81
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by Jeff-Groves View Post
Try changing the collision mesh with the one the city GR2 has.
Jeff, you are the man!
After so much messing, the too short LOD range issue is gone for good, and the red pillar rock is now visible from far, far away



What matters for terrain object's rendering distance isn't actually the size of the collision mesh, but the radius of main model's bounding sphere. You put me in the right direction, thank you very much!

This little discovery means that we can add to the game any kind of landmark with all the goodies of the GR2 format. You know what will the next model that I am going to import. Time to PM Jim
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 01-19-19, 09:26 PM   #82
Seaowl
Sailor man
 
Join Date: Nov 2018
Posts: 43
Downloads: 66
Uploads: 0
Default

Amazing!
Thanks to both of you for all these efforts.
Beeing on the edge for the next release now...
Seaowl is offline   Reply With Quote
Old 01-20-19, 04:39 AM   #83
Muckenberg
Planesman
 
Join Date: Dec 2014
Location: Czech Republic
Posts: 193
Downloads: 527
Uploads: 0
Default

Muckenberg is offline   Reply With Quote
Old 01-20-19, 03:11 PM   #84
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,425
Downloads: 131
Uploads: 0


Default

Fantastic work My Friend!
Jeff-Groves is offline   Reply With Quote
Old 01-20-19, 03:45 PM   #85
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by Jeff-Groves View Post
Fantastic work My Friend!
Now that the rendering range issue is solved, something else bothers me

How it is:


How it should be:


Bottom drawing courtesy of Kendras, re-scaled and georeferenced by me.

Each quadrant in the above charts corresponds to one of the SH5 height maps and it measures 2.5 x 2.5 minutes (i.e. 5 x 5 km2). The map resolution is 25 meters. SH5 terrain can be edited using the inbuilt Terrain Editor. The output is one or more of the height maps that I described above.
Unfortunately their editing in photoshop is not easy. You can open them, but all you is an apparently meaningless bunch of grey pixels. The height information contained in them seems encoded or mixed with noise of some sort
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 01-20-19, 05:11 PM   #86
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,425
Downloads: 131
Uploads: 0


Default

You can see better details if you zoom out to 12.5% actual size.

Not that it will help to hand edit them but take a look at them like this.
You may figure something out.
Jeff-Groves is offline   Reply With Quote
Old 01-20-19, 05:43 PM   #87
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by Jeff-Groves View Post
You can see better details if you zoom out to 12.5% actual size.

Not that it will help to hand edit them but take a look at them like this.
You may figure something out.
Yes, you are right: if you look at them you can see a vague resemblance with the terrain profile, but very faint. I asked Mihai on the possibility to convert TE-generated raw files to something that we can edit even outside TE, and I have just received an answer:

Quote:
Originally Posted by Pintea
Here you go, though this won’t help you much since photoshop can’t do custom things like you need.





Code:
elevations[256] =

{

       // Underwater band

       -1500.f, -448.f, -416.f, -384.f, -352.f, -320.f, -288.f, -256.f,

       -234.f,  -220.f, -211.f, -202.f, -193.f, -184.f, -175.f, -166.f,

       -157.f, -148.f, -137.f, -128.f, -120.f, -111.f, -104.f, -97.f,

       -90.f,  -85.f,  -80.f,  -76.f,  -72.f,  -68.f,  -64.f,  -60.f,

       -56.f,  -52.f,  -48.f,  -44.f,  -40.f,  -37.f,  -34.f,  -32.f,

       -30.f,  -28.f,  -27.f,  -26.f,  -25.f,  -24.f,  -20.f,  -10.f,

 

       // Skipping from -15 directly to above zero makes the shore look jagged,

       //            but avoids problems with ships running into low ground around harbors and shore areas

       // Ideally, all harbor areas and battle zones should be manually edited to lower the ground in ships' paths.

 

       // 0-64 meter band

       10.f,    20.f,       25.f,   20.f,   25.f,   30.f,   35.f,   40.f,

       44.f,   45.f,   46.f,   47.f,   48.f,   49.f,   50.f,   51.f,

       52.f,   53.f,   54.f,   55.f,   56.f,   57.f,   58.f,   59.f,

       60.f,   61.f,   62.f,   63.f,   64.f,   65.f,   66.f,   67.f,

 

       // 64-192 meter band

       68.f,   70.f,   72.f,   76.f,   80.f,   84.f,   88.f,   92.f,

       96.f,  100.f,  104.f,  108.f,  112.f,  116.f,  120.f,  124.f,

       128.f,  132.f,  136.f,  140.f,  144.f,  148.f,  152.f,  156.f,

       160.f,  164.f,  168.f,  172.f,  176.f,  180.f,  184.f,  188.f,

 

       // 192-448 meter band

       192.f,  200.f,  208.f,  216.f,  224.f,  232.f,  240.f,  248.f,

       256.f,  264.f,  272.f,  280.f,  288.f,  296.f,  304.f,  312.f,

       320.f,  328.f,  336.f,  344.f,  352.f,  360.f,  368.f,  376.f,

       384.f,  392.f,  400.f,  408.f,  416.f,  424.f,  432.f,  440.f,

 

       // 448-960 meter band

       448.f,  464.f,  480.f,  496.f,  512.f,  528.f,  544.f,  560.f,

       576.f,  592.f,  608.f,  624.f,  640.f,  656.f,  672.f,  688.f,

       704.f,  720.f,  736.f,  752.f,  768.f,  784.f,  800.f,  816.f,

       832.f,  848.f,  864.f,  880.f,  896.f,  912.f,  928.f,  944.f,

 

       // 960-1984 meter band

       960.f,  992.f, 1024.f, 1056.f, 1088.f, 1120.f, 1152.f, 1184.f,

       1216.f, 1248.f, 1280.f, 1312.f, 1344.f, 1376.f, 1408.f, 1440.f,

       1472.f, 1504.f, 1536.f, 1568.f, 1600.f, 1632.f, 1664.f, 1696.f,

       1728.f, 1760.f, 1792.f, 1824.f, 1856.f, 1888.f, 1920.f, 1952.f,

 

       // 1984-8000 meter band

       1984.f, 2048.f, 2112.f, 2176.f, 2240.f, 2304.f, 2368.f, 2432.f,

       2496.f, 2560.f, 2624.f, 2688.f, 2752.f, 2816.f, 2880.f, 2944.f,

       3008.f, 3072.f, 3136.f, 3200.f, 3264.f, 3392.f, 3584.f, 3712.f,

       3840.f, 3968.f, 4032.f, 4160.f, 4288.f, 4416.f, 4544.f, 4762.f,

       4800.f, 5184.f, 5412.f, 5668.f, 5846.f, 6080.f, 6208.f, 6436.f,

       6664.f, 6892.f, 7020.f, 7276.f, 7404.f, 7632.f, 7888.f, 8000.f

}
Whad do you get from it?
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 01-20-19, 06:31 PM   #88
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,425
Downloads: 131
Uploads: 0


Default

Appears to be what is hard coded somewhere is my guess at the moment.
Jeff-Groves is offline   Reply With Quote
Old 01-20-19, 06:39 PM   #89
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by Jeff-Groves View Post
Appears to be what is hard coded somewhere is my guess at the moment.
I wish that we could read that matrix in ascending order from the top left to the bottom right, assigning to each height value a grey value as follows:

-1500=0 ; -448=1 ; ... ; 7888=254 ; 8000=255

Am I asking too much?

EDIT: I have just received confirmation; my guessing was correct

Now I need to create two custom palettes: one for sorting grey values of those raw files in ascending height order, so that we can edit them in photoshop, and a second palette for sorting values back in the SH5 (dis-)order
__________________
_____________________
|May the Force be with you!|
...\/

Last edited by gap; 01-20-19 at 06:58 PM.
gap is offline   Reply With Quote
Old 01-20-19, 06:59 PM   #90
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,425
Downloads: 131
Uploads: 0


Default

I'm playing with one of the RAW files now.
So the scale is 256 colors as the code snippet shows.
Each pixel is 8 bits I believe.
In Hex that all checks out.

Last edited by Jeff-Groves; 01-20-19 at 07:17 PM.
Jeff-Groves 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 06:13 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.