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 06-21-20, 01:37 PM   #1
kapuhy
Grey Wolf
 
Join Date: Oct 2010
Location: Poland
Posts: 873
Downloads: 72
Uploads: 3
Default Iluminating gr2 ships test

First of all, I'd like to give credit and thanks to Gap for coming up with this idea - I just implemented it according to his instructions.

Only iluminated ships at the moment in SH5 are .dat format units introduced by vdr1981 in TWoS. I was looking for a way to have neutral iluminated versions of my coastal units when Gap suggested trying to use HarborObjectCtrl for lights that would behave like harbor lights in game's ports - light up only in darkness and be off during the day.

I've did some experimenting with using this controller on mine and stock ships, as well as Rosomaha's NKC3, here's the result:

C3 Cargo, Motor Coaster:


Trawler:


Italian Liner:


C2 Cargo:


Coastal Tanker:


C3 Cargo:


And here's the video showing how lights behave during sunset:



So far so good - controller does work on ships and I did light maps to iluminate portholes for all stock ships that are used by neutral nations in TWoS (I didn't touch warships or merchants only used by fighting nations). Couple problems that did show up:

1) Some stock ships have protholes UV-mapped to the same parts of diffuse texture as other ships parts - namely Ranger tanker, N3 Cargo, Hod Island, C1B Cargo. These ships need their portholes remapped to some other texture part:



2) I intended to create just clones, sharing the same model but with different .sim and .eqp files (the way that Duke of York uses KGV model but with different dsd,eqp and other files). It appears that game still uses original ship's sim file, even if modified one is provided in clone's folder.

3) At very close range, the glow disappears (like if camera is within 30-40 meters of the ship). The same happens to port buildings so this is just how this controller works.

4) At very long range, lights also tend to disappear on many ships, this time because portholes are not included in LOD file (exception is C3 where windows are painted on wall texture and my trawler which includes windows in LOD file). This could again be fixed by adding a simple triangle for every porthole in LOD model and UV-mapping it to lit part of diffuse texture.

5) Navigation lights are not included on stock ships. Rosomaha's C3 and most of my my coasters have them, but on stock merchants they would need to be added to the model.

6) No halo. This only lights up texture, without "halo" or "light ray" effect that is visible on lighthouses and .dat format iluminated vessels.
kapuhy is offline   Reply With Quote
Old 06-21-20, 02:56 PM   #2
Texas Red
Fastest Gun Around
 
Texas Red's Avatar
 
Join Date: Aug 2019
Location: Agua Fira, New Mexico
Posts: 2,376
Downloads: 527
Uploads: 5
Default

Looks good! I cannot wait!

Keep up the great work!
__________________
There are no secrets to success. It is the result of preparation, hard work, and learning from failure.
— Colin Powell


I'm not very active on the forums anymore. If you have a question, please DM me and I'll respond ASAP!
Texas Red is offline   Reply With Quote
Old 06-21-20, 05:22 PM   #3
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Amazing work kapuhy

Sorry for not having yet replied your last e-mail. I think you had encountered some problems with the usage of the HarborObjectCtrl controller on some ships. Did you manage tracking down and solving the issue?

Regarding the other problems that you have described:


Quote:
Originally Posted by kapuhy View Post
1) Some stock ships have protholes UV-mapped to the same parts of diffuse texture as other ships parts - namely Ranger tanker, N3 Cargo, Hod Island, C1B Cargo. These ships need their portholes remapped to some other texture part:
Yes, you could remap porthole's UV coordinates, or you could assign to them a material/ texture purposely created for them.

Quote:
Originally Posted by kapuhy View Post
2) I intended to create just clones, sharing the same model but with different .sim and .eqp files (the way that Duke of York uses KGV model but with different dsd,eqp and other files). It appears that game still uses original ship's sim file, even if modified one is provided in clone's folder.
As far as I know, only cfg, eqp and sns files can be used to customize proxy clones. All the other files are from the parent unit. What could be surely done, is separating portholes and navigation lights from the ship models and setting them up as equipment objects to be linked to their respective units through eqp files. For each ship model we could have two porthole equipment item: one lit for neutral ships, and one unlit for non-neutrals.

Quote:
Originally Posted by kapuhy View Post
3) At very close range, the glow disappears (like if camera is within 30-40 meters of the ship). The same happens to port buildings so this is just how this controller works.

[...]

6) No halo. This only lights up texture, without "halo" or "light ray" effect that is visible on lighthouses and .dat format iluminated vessels.
Yes, unlike light nodes used to illuminate .dat ships (which cast "real" light) port lights are fake lights. The advantage is that their rendering is not GPU-intensive, the disadvantages are the ones you have described above. You could fake light halos by painting them on the surfaces close to a light source, but that is probably too complicated for the small benefit involved.

Quote:
Originally Posted by kapuhy View Post
4) At very long range, lights also tend to disappear on many ships, this time because portholes are not included in LOD file (exception is C3 where windows are painted on wall texture and my trawler which includes windows in LOD file). This could again be fixed by adding a simple triangle for every porthole in LOD model and UV-mapping it to lit part of diffuse texture.
If you follow my suggestion to set up portholes and navigation lights as equipment objects, they will be applied to the LOD models as well as to the main models

Quote:
Originally Posted by kapuhy View Post
5) Navigation lights are not included on stock ships. Rosomaha's C3 and most of my my coasters have them, but on stock merchants they would need to be added to the model.
Likewise, those could be added to each stock ships as external (equipment) object
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 06-22-20, 03:12 PM   #4
kapuhy
Grey Wolf
 
Join Date: Oct 2010
Location: Poland
Posts: 873
Downloads: 72
Uploads: 3
Default

Quote:
Originally Posted by gap View Post
I think you had encountered some problems with the usage of the HarborObjectCtrl controller on some ships. Did you manage tracking down and solving the issue?
Kinda, part of the issue was Goblin throwing a fit when trying to display ships with _night textures, but I still don't know why editor also CTD's on stock, unmodified NF_boat_1 and NRTW files for me, unless I launch them from already running editor window. But that's the problem I can go around.

Quote:
Originally Posted by gap View Post
As far as I know, only cfg, eqp and sns files can be used to customize proxy clones. All the other files are from the parent unit. What could be surely done, is separating portholes and navigation lights from the ship models and setting them up as equipment objects to be linked to their respective units through eqp files. For each ship model we could have two porthole equipment item: one lit for neutral ships, and one unlit for non-neutrals.
That's a bummer. Yes, I know we can go this way (and it seems we'll have to), I simply hoped for an elegant solution that would not require any modifications to base unit.

Quote:
Originally Posted by gap View Post
Yes, unlike light nodes used to illuminate .dat ships (which cast "real" light) port lights are fake lights. The advantage is that their rendering is not GPU-intensive, the disadvantages are the ones you have described above. You could fake light halos by painting them on the surfaces close to a light source, but that is probably too complicated for the small benefit involved.
Not complicated at all on models like C3 Cargo with painted windows (I did exactly that on this very unit), but outright impossible with units where porthole is modeled and UV-map of hull around it overlaps with parts of hull that are nowhere near portholes.
kapuhy is offline   Reply With Quote
Old 06-22-20, 05:58 PM   #5
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by kapuhy View Post
Kinda, part of the issue was Goblin throwing a fit when trying to display ships with _night textures, but I still don't know why editor also CTD's on stock, unmodified NF_boat_1 and NRTW files for me, unless I launch them from already running editor window. But that's the problem I can go around.
Well, Editor might be more strict than the game itself when it comes to some controllers; maybe Goblin is not expecting HarborObjectCtrl to be linked to a unit, but don't quote me on that.

A while ago, Goblin Editor's viewport stopped working on my computer. Everything worked, but the loaded models weren't displayed. The problem lasted for several months, then as suddenly as it had appeared it vanished. I suspect a graphic driver update solved it but I am not 100% sure.

More recently, Silent3ditor started crashing every time I tried running it. In that case, skwasjer's help was providential:

https://www.subsim.com/radioroom/sho...postcount=1341

Quote:
Originally Posted by kapuhy View Post
That's a bummer. Yes, I know we can go this way (and it seems we'll have to), I simply hoped for an elegant solution that would not require any modifications to base unit.
I understand that. A possible solution might be keeping stock portholes, and modelling illuminated porthole glasses as optional equipment for neutral ships only. In order to avoid clipping/flickerings, the illuminated glasses should be a bit bigger than 'standard' glasses, and they should stick slightly in front of them.

Quote:
Originally Posted by kapuhy View Post
Not complicated at all on models like C3 Cargo with painted windows (I did exactly that on this very unit), but outright impossible with units where porthole is modeled and UV-map of hull around it overlaps with parts of hull that are nowhere near portholes.
Yes sure, where overlapping UV maps apply, light cones can't be painted directly on ship surfaces. You should cover the stock surfaces with purposely modelled and UV-mapped 'illuminated' surfaces. Again, those surfaces should be linked to ship units via eqp files, having care that they slightly stick out from the stock surfaces
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 06-28-20, 12:05 PM   #6
Rosomaha
Loader
 
Join Date: Nov 2012
Location: Russia
Posts: 83
Downloads: 72
Uploads: 1
Default

Excellent work.
On the one hand, I liked the night lights of ships, with the SH3 mods, but at the same time I did not like this solution, because of their constant glow, including on a Sunny day that looked unnatural. This seems to be the best alternative to this. . Only C3 seems to have a very bright glow.)

Last edited by Rosomaha; 06-28-20 at 12:15 PM.
Rosomaha is offline   Reply With Quote
Old 02-19-22, 03:15 PM   #7
kapuhy
Grey Wolf
 
Join Date: Oct 2010
Location: Poland
Posts: 873
Downloads: 72
Uploads: 3
Default

Necroing my old thread after fiddling some more with this controller.

Turns out I found an elegant solution to problem I had with it - namely, the fact that you can't have separate .sim files for clone ships unless you make them full-on separate models with their own gr2 files and everything.

This meant that if I wanted a neutral version of a ship with lights and non-neutral without, I had to make two copies of all files in ship's folder. Repeat this for many ships and your Sea folder starts to look very fat.

As it turns out, there's a solution for that. HarborObject controller requires a small additional _night texture to work. If controller doesn't find this texture, it doesn't do anything, so one can simply make two skins for a ship:

a) "neutral" skin, that has additional _night texture in textures folder
b) "non-neutral" skin that doesn't have _night texture

So I could now easily make beautifully illuminated versions of all .gr2 format ships, if not for one remaining issue that is crashing Goblin editor while trying to further edit a ship with HarborObject controller... ship does seem to work without problems or CTD's in game, but it blows up Goblin Editor every time
kapuhy 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 03:38 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.