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: 874
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: 874
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: 874
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
Old 02-22-22, 01:14 PM   #8
Angelis
A-ganger
 
Join Date: Dec 2009
Posts: 77
Downloads: 143
Uploads: 0
Default

Ingenious!
Angelis is offline   Reply With Quote
Old 02-22-22, 01:52 PM   #9
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,397
Downloads: 131
Uploads: 0


Default

Now stop depending on Goblin to do things.
S3D with the proper controllers add-ins can do things Goblin can't.

Rule 1
If it works In-Game? Then it works.
Rule 2
If Editors say it won't work? See Rule 1!
Jeff-Groves is offline   Reply With Quote
Old 02-23-22, 02:23 PM   #10
tonschk
Admiral
 
Join Date: Mar 2007
Posts: 2,200
Downloads: 172
Uploads: 0
Default

Very good great work!
__________________
What we do in life echoes in Eternity
tonschk is offline   Reply With Quote
Old 02-27-22, 08:23 PM   #11
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by kapuhy View Post
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
A possible alternative:

Separate 3D portholes and windows from the main model and set them as configurable equipment. For each vessel there should be two nearly identical copies of such an equipment: one with the HarborObject controller and one without it. Since each proxy clone uses its own .eqp file, you can easily set up two variants of the same unit, one with lights on and the other with darkened lights.

Advantages of this method:

- no more Goblin Editor CTD's
- no need to have two copies of the same texture.


Disadvantages:

- stock models and all previously created custom vessels would require their 3D models to be edited.
- more files in the Library folder and higher chance of Id conflict (though, talking about GR2 objects, this one should be a remote chance as long as no duplicated model names are used).
- complex illumination effects like illuminated funnels, superstructure etc. become impossible, unless those parts are also separated from the main model.

Quote:
Originally Posted by Jeff-Groves View Post
Now stop depending on Goblin to do things.
S3D with the proper controllers add-ins can do things Goblin can't.

Rule 1
If it works In-Game? Then it works.
Rule 2
If Editors say it won't work? See Rule 1!
I agree. I strongly recommend Rosomaha's S3d Configurator for full compatibility with the new SH5 controllers.

The one thing that Goblin Editor does better than S3d, is 3D model shading. Since Goblie uses the same shaders as the game, one can reliably use it for previewing the combined effect of diffuse, specular, normal and AO maps.
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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 02:53 AM.


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.