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 > SHIII Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 10-05-17, 05:02 PM   #1
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Still talking about the illuminated windows, I have seen that you have set their material as 'emissive', similar to what Anvar made with GWX neutral ships.
This is indeed an effective and easy way to make an object to look luminous in game, but such a lights are always "on".
If you are looking for a more polished method to make ship lights to shine only at night, you can experiment with the CityLights controller. I have been looking into game files for its usage, and I think I have understood the way it works and how to set up objects/materials for it. If you are interested, I can explain here
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 10-05-17, 10:29 PM   #2
Kendras
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Quote:
Originally Posted by gap View Post
Still talking about the illuminated windows, I have seen that you have set their material as 'emissive', similar to what Anvar made with GWX neutral ships.
This is indeed an effective and easy way to make an object to look luminous in game, but such a lights are always "on".
If you are looking for a more polished method to make ship lights to shine only at night, you can experiment with the CityLights controller. I have been looking into game files for its usage, and I think I have understood the way it works and how to set up objects/materials for it. If you are interested, I can explain here
I'm interested !

By the way, there are also light halos (texture) to add for position lights (green and red, and on the masts) : I don't think they can be controlled to be switched off during day time.
  Reply With Quote
Old 10-06-17, 04:04 AM   #3
VonDos
Admiral
 
Join Date: Mar 2007
Location: Italy
Posts: 2,235
Downloads: 75
Uploads: 50


Default

@Gap yes, please =) explain!

Today i've reworked a little superstructure's design. More linear and detailed:





Next heavy work will be adjust portholes in right re-worked position...
__________________

Those, others and WIP ships are avaiable in my SHIPYARD here:
http://www.subsim.com/radioroom/showthread.php?t=136508
VonDos is offline   Reply With Quote
Old 10-06-17, 12:50 PM   #4
Kendras
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Quote:
Originally Posted by VonDos View Post
@Gap yes, please =) explain!

Today i've reworked a little superstructure's design. More linear and detailed:



Looks clean !

Quote:
Originally Posted by VonDos View Post
Next heavy work will be adjust portholes in right re-worked position...
I can do it if you want. I would like each porthole to be at the real place, and right dimension (I think yours are a bit too small).

Last edited by Kendras; 10-06-17 at 01:07 PM.
  Reply With Quote
Old 10-06-17, 01:26 PM   #5
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by Kendras View Post
I can do it if you want. I would like each porthole to be at the real place, and right dimension (I think yours are a bit too small).
That's a deal that I would jump on VonDos, accept Kendras offer, before he realizes the troubles he is getting in
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 10-06-17, 10:23 PM   #6
VonDos
Admiral
 
Join Date: Mar 2007
Location: Italy
Posts: 2,235
Downloads: 75
Uploads: 50


Default

Quote:
Originally Posted by gap View Post
That's a deal that I would jump on VonDos, accept Kendras offer, before he realizes the troubles he is getting in
More than OK for me.
PM Sent to Kendras =)

@Gap, thanks for your description!
__________________

Those, others and WIP ships are avaiable in my SHIPYARD here:
http://www.subsim.com/radioroom/showthread.php?t=136508

Last edited by VonDos; 10-06-17 at 10:31 PM.
VonDos is offline   Reply With Quote
Old 10-07-17, 02:50 AM   #7
Kendras
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Quote:
Originally Posted by VonDos View Post
More than OK for me.
PM Sent to Kendras =)
PM sent
  Reply With Quote
Old 10-06-17, 01:20 PM   #8
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by VonDos View Post
Today i've reworked a little superstructure's design. More linear and detailed
To be honest I can't spot the difference but we trust you

Quote:
Originally Posted by VonDos View Post
Next heavy work will be adjust portholes in right re-worked position...
Yep, that's the hard part

Quote:
Originally Posted by Kendras View Post
I'm interested !
Quote:
Originally Posted by VonDos View Post
@Gap yes, please =) explain!
Okay.

How it works

That's probably easier for you to understand if you look at stock files, than it is for me to explain. I suggest you to open Harbor_kit.dat using S3d, and to look for one of the house models contained in it. Let's take House08_A for example.
If you select its embedded 3D model, you will see that it got two map channels.

 
If you are not familiar with secondary map channels, be aware that the 1st channel is the UV projection used for mapping on an object its main texture; the 2nd channel, on turn, is used in SHIII, IV and 5 for mapping on the same object another texture (such as a specular, an ambient occlusion map, etc.), when the latter and the main texture do not coincide perfectly.


If you click on the export button, S3d will let you to choose whether you want to export only the main map channel or both channels, and it will respectively name them *.obj and *-uv2.obj . If you open those objects in a 3D application, you should note two things:
  • the first remarkable feature is that both objects have identical x,y and z vertex/edge/face coordinates, but different UV projections, but that's no surprise if you have read the spoiler above.
  • the second remark, is that the two objects use two materials each, the 1st material corresponding to the whole house, and the 2nd one being limited to a couple of "redundant" faces, overlapping the two main facades on the house model, where doors and windows are painted.

Let's have look at those material in Harbor_kit.dat now, so that we can discover how they are set.
Both of them are named Kit_00.tga, but they do different jobs, and they are set differently.
There is not much to be said about the 1st material: it got the day-time texture embedded and, as for the rest, it is set as may other materials in game. The 2nd material is a bit more unusual though; for a start, we should note that it got a texture map controller attached, being set as "Ambient Occlusion" and with a night-time texture embedded. The second remarkable feature is the CityLights controller also attached to it, with DayIntensity and NightIntensity values that can be used for adjusting the transition from light to darkness.

Summing up, we have two texture maps and two materials, with four possible combinations of them. If my guess is right, only two combinations are active in game though:



The combination of UV map #1 and material #1 is the texture we normally see. Below a certain ambient light level, as set with the DayIntensity parameter, the combination of UV map #2 and material #2 start being gradually applied to the regular texture, until it reaches it maximum when ambient luminosity falls down the level set with the NightIntensity parameter.

I ignore the detail of how game shaders blend the two textures together, but it is possible thatthe night nexture it is applied to the main texture as a self-illumination map, or as a combination of self-illumination and ambient occlusion map.

How to set 3D portholes to emit light only at night

- Once you have finished moving/rotating them, group all the porthole glasses in a single object, separate from their ring-shaped frames and from the remaining ship parts. If you want, you can send the resulting object to me, for me to weld the redundant split edges (thus reducing vertex/edge count) and to rework a bit the UV map.

- After that, you should duplicate the object, assign a different material to each of the two copies of the porthole-glass-object, and re-group the two of them in a single object.

- When you have finished, export the resulting object two time, using the names whateveryouwant.obj and whateveryouwant-uv2.obj

- Create an empty library (dat) file, and copy the following chunks from Harbor_kit.dat in the new file:



 
A recommendation: Copy the chunks using the Ctrl **** C key combination to copy the chunks with all their subchunks. You could as well add the chuncks manually, using S3d's 'Append new chunk' or 'Append new child chunk' menus, but while working on specular maps, I have noticed that sometimes freshly created chunks, or chunks copied from an unappropriate file, don't work as supposed (I guess there might be some unknown special flags/properties that can't be seen nor edited in S3d, though the program can read/write them)


- Make sure that you have remapped all the Id's, and import the recently exported object in the 3d model chunk. If you select the one with the shortest name, S3d will automatically the one with the -uv2 suffix in its name, and it will give you the option to import it.

- Replace the textures embedded to the two materials with appropriate ones. Unless you want to paint some detail on them (like dust, sky reflections or smooth light transitions), you won't need big textures. Even the minimun size allowe (4x4 pixels IIRC) would be okay. The main texture should be painted with a shade of dark blue-grey or whatever you prefer, whereas the night texture can be painted light grey, almost white, or in a very bright tone of yellow.

- At this point, you can link the illuminated portholes to the main model through eqp file. you might also want to create a non-illuminated version of them for usage after war start.

That should be all. More or less the same method could be used for making ship surfaces, like decks and walls, illuminated at night, but for smooth light transition effects we should remap the UV projection of the second map channel, and create an appropriate texture. Probably too much work for a ship we will seldomly see in game in her neutral configuration

Quote:
Originally Posted by Kendras View Post
By the way, there are also light halos (texture) to add for position lights (green and red, and on the masts) : I don't think they can be controlled to be switched off during day time.
The method I have described above apllies to gloving lights, but who knows, maybe we can device some trick for making it to work with light halo effects too. Imagine how cool would be our lighthouses if we manage making their light to fade away during the day and to become proportionally more shiny at night
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 10-07-17, 07:36 AM   #9
Kendras
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Quote:
Originally Posted by gap View Post
After that, you should duplicate the object, assign a different material to each of the two copies of the porthole-glass-object, and re-group the two of them in a single object.
How to do that ?
  Reply With Quote
Old 10-07-17, 08:08 AM   #10
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by Kendras View Post
How to do that ?
Simple.
  1. Select one of the two objects in body selection mode.
  2. Switch to face selection mode.
  3. Right click on the geometry window.
  4. Right click on 'Material' in the following context menu.
  5. Enter the new material name.
  6. Undo the selection (space bar).
  7. Repeat the steps 1-5 for the other copy of the same object, using a different material name.
  8. When you have finished, select both objects in body selection mode.
  9. Right click on the geometry window.
  10. Choose 'Combine' from the context menu.

Done
__________________
_____________________
|May the Force be with you!|
...\/
gap 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 08:54 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.