SUBSIM Radio Room Forums

SUBSIM Radio Room Forums (https://www.subsim.com/radioroom/index.php)
-   SHIII Mods Workshop (https://www.subsim.com/radioroom/forumdisplay.php?f=195)
-   -   [WIP] Lighthouses mod (https://www.subsim.com/radioroom/showthread.php?t=228731)

gap 07-23-17 07:28 AM

Hi Kendras,

when you get time, if you select any 3d model chunk in s3d, there is an uncaptioned parameter to the right of the "Model info" section, about under the Import/Export buttons, whose exact meaning is beyond my understanding.

In most SHIII files I have seen so far (and for all the 3d objects linked to a material with SpecularMask action controller and with an alpha channel in their texture), the said parameter is set to 4, but in our files it is set to 6.

I start wondering if this is not the culprit for the corrupted reflections on our model. I know the chance of this being true is low, but as someone else said: "when you have eliminated the impossible, whatever remains, however improbable, must be the truth". Maybe worth a try? :hmm2:

Kendras 07-23-17 09:33 AM

Quote:

Originally Posted by gap (Post 2502201)
Hi Kendras,

when you get time, if you select any 3d model chunk in s3d, there is an uncaptioned parameter to the right of the "Model info" section, about under the Import/Export buttons, whose exact meaning is beyond my understanding.

In most SHIII files I have seen so far (and for all the 3d objects linked to a material with SpecularMask action controller and with an alpha channel in their texture), the said parameter is set to 4, but in our files it is set to 6.

I start wondering if this is not the culprit for the corrupted reflections on our model. I know the chance of this being true is low, but as someone else said: "when you have eliminated the impossible, whatever remains, however improbable, must be the truth". Maybe worth a try? :hmm2:

Hi Gap,

No. It doesn't solve our problem. :hmph:

I think the only solution to apply a specular effect is the value to choose (specular strenght), even if it gives only a uniform effect.

gap 07-23-17 11:43 AM

Quote:

Originally Posted by Kendras (Post 2502234)
Hi Gap,

No. It doesn't solve our problem. :hmph:

I think the only solution to apply a specular effect is the value to choose (specular strenght), even if it gives only a uniform effect.

The way specular reflections are set in our files is nothing experimental; if you look at stock ships, you will see that their materials have the SpecularMask controller and textures with an alpha channel. I don't get why those settings work for them, but not for our unit. Can the problem be in the texture we are using?

I ask you to do one last test to narrow down the problem: export the hull texture (NBB_BismarkNewest.tga) from NBB_Bismark, rename it LH_LaPlate.tga, and drop it in the tex folder of our mod, therefore replacing the original texture, but not before you embedded it (the original version of LH_LaPlate.tga) to a copy of NBB_Bismark.dat which you will have added to our mod. Add then the Bismark to our testing mission and run it.

If our texture/alpha channel is "wrong", at this point the Bismark will have an almost antirely black hull, and our lighthouse will have messed up texture but with correct looking specular reflections. Vice versa, if the problem resides elsewhere, the Bismark will have messy -but not black- textures, and our lighthouse will still look black. :hmm2:

gap 07-23-17 01:07 PM

Quote:

Originally Posted by gap (Post 2502256)
I ask you to do one last test to narrow down the problem...

To ease your task, I have created a patch that you can enable on top of the last alpha to test what I am suggesting:

https://www.mediafire.com/?5u88cqe4j1v484v

All you have to do is adding the Bismark to our testing mission, and run it after enabling the patch.

On a partly unrelated note, something I have noticed about stock sea units, is that they have two UV coordinates/Map channel sets. That's common in SHIV & 5 units, the second UV set being used for amblient occlusion mapping. So far, I thought that the apparently redundant Map channels in SHIII were the leftover of an abandoned feature, as their UV unwrapping is quite messy, but I start wondering if -messy as it is- it isn't required for additonal map channels (normal or specular maps) to be rendered on the model. If that was true, the implementation of only two Map channels would explain why, at best, we can only have one additional map (besides the diffuse texture) for any given model :hmmm:

Kendras 07-23-17 03:54 PM

Quote:

Originally Posted by gap (Post 2502270)
To ease your task, I have created a patch that you can enable on top of the last alpha to test what I am suggesting:

https://www.mediafire.com/?5u88cqe4j1v484v

All you have to do is adding the Bismark to our testing mission, and run it after enabling the patch.

My game stays blocked on the start screen of the mission ...

:k_confused: :wah:

More tests tomorrow.

:Kaleun_Sleep:

gap 07-23-17 05:52 PM

Quote:

Originally Posted by Kendras (Post 2502297)
My game stays blocked on the start screen of the mission ...

:k_confused: :wah:

The test patch 1 contains only two files. I suppose it will be easy understanding which one makes the game to freeze. I suspect NBB_Bismark.dat: the version of it I have tweaked might come from GWX and might not be compatible with your game installation. The one change I made to it, is replacing the embedded hull texture with the one of our lighthouse. :03:

Quote:

Originally Posted by Kendras (Post 2502297)
More tests tomorrow.

:Kaleun_Sleep:

No problem. Tomorrow, if you get time, also run a test with testing patch #2:

https://www.mediafire.com/?w7b55ob5ros1g52

This patch adds additional map channels to the tourelle and to all its parts. Maybe it is not the ultimate fix to the specular mask problem but, if my suspects are right, it should definitely make some difference in game.
If you can't see any, we will remove the alpha channels from our textures, and we will keep their implemetation (if still possible) as last task before release :salute:

Kendras 07-24-17 07:00 AM

Results of tests with patch 1 :

- the .tga file embedded in the bismark.dat must be resized at 512x512, original size makes the mission impossible to load.

- still a problem of black pixels on the tower model

- pics :

bismark :



tower :


Kendras 07-24-17 07:05 AM

Result of test with patch 2 :

nothing new, tower is still black (and yes, i have corrected added the new files, there was no data folder)

gap 07-24-17 02:26 PM

Quote:

Originally Posted by Kendras (Post 2502392)
Results of tests with patch 1 :

- the .tga file embedded in the bismark.dat must be resized at 512x512, original size makes the mission impossible to load.

Maybe there is a limit to the size an embedded texture can have. Anyway I think for final release it wil better resizing our textures and/or compressing them :03:

Quote:

Originally Posted by Kendras (Post 2502392)
- still a problem of black pixels on the tower model

Okay, at least now we know that the critical element is not our texture per se :up:

Quote:

Originally Posted by Kendras (Post 2502394)
Result of test with patch 2 :

nothing new, tower is still black (and yes, i have corrected added the new files, there was no data folder)

Sorry, my bad for the wrong file structure :doh:

Honestly I was expecting a different answer by you. After reading some other posts on the forum, I think that adding the new map channels to our meshes puts us in the right direction, but obviously there is something else we do wrong.

Unfortunately, as much as I looked into other modders' units and objects, I couldn't find in their files any working example of what I want to do with our lighthouses. From what I have read, I am pretty sure that Hans Witteman made an extensive use of the same concept for specular reflections of his U-BOOT_HAHD project but, pity for us, this brilliant mod was abandoned long ago and Hans is no longer an active member.

All in all, I still have some ideas on what might be causing our reflections not to work and I feel like we are just one step away from the solution. Nonetheless I also think it is about time to take a short rest from texture map issues and to focus on other and more important aspects. IMO, so far our small team has made an excellent job; let not our recent failures spoil our morale :up:

That said, I hope to release tomorrow a new alpha version with some fixes/improvements and a few new features. I ìf we keep up this pace, I don't see us too far away from the beta fase :salute:

Kendras 07-24-17 02:37 PM

Quote:

Originally Posted by gap (Post 2502473)
After reading some other posts on the forum, I think that adding the new map channels to our meshes puts us in the right direction, but obviously there is something else we do wrong.

Yes, yes, something else. Maybe the_frog can say more to us.

Quote:

Originally Posted by gap (Post 2502473)
... and I feel like we are just one step away from the solution.

It's my opinion too.

Quote:

Originally Posted by gap (Post 2502473)
IMO, so far our small team has made an excellent job; let not our recent failures spoil our morale :up:

:yep:

gap 07-24-17 03:06 PM

Quote:

Originally Posted by Kendras (Post 2502475)
Yes, yes, something else. Maybe the_frog can say more to us.:

Yes, hopefully he will pop up one of the next days and he will give us an insight on the secrets of SHIII's texture mapping, but of course the know-how of all the other SHIII hard-core modders and 3d modellers is most welcomed too :D :salute:

Kendras 07-25-17 07:04 AM

Just an idea : perhaps the 3D model has to be textured twice : one with a diffuse map, and one with the specular map. In S3D, you create 2 materials, one without specular map controller and big opaque tga, and the other with specular map controller and the 512x512 transparent tga. :03:

gap 07-25-17 08:55 AM

Quote:

Originally Posted by Kendras (Post 2502580)
Just an idea : perhaps the 3D model has to be textured twice : one with a diffuse map, and one with the specular map. In S3D, you create 2 materials, one without specular map controller and big opaque tga, and the other with specular map controller and the 512x512 transparent tga. :03:

If you look at SHIII's Bismarck, her main model has three materials linked to it: The first material, named 'normal' is used on the hull, and it has a texture with alpha channel embedded and a SpecularMask controller attached. The second material, named 'complete', is mapped on the decks and it has no alpha channel nor SpecularMask controller; the third material, named '2sided', is used on ladders, railings, etc, it uses the same texture as the 'normal' material and likewise it, it has a SpecularMask controller attached but, as the name says, it has the 'Two sided' flag enabled. So, in total, we have two 'specular' materials linked to the same object, and both have the specular map in the alpha channel of their diffuse texture. Other stock units that I have had a glance into, are not dissimilar from the Bismarck.
What you are suggesting, would probably require the usage of the Texture Map chunk in place of (or together with?) the Specualar Mask controller. This chunk, allows additional texture maps to be linked to the diffuse map. Three texture types can be selected: Ambient Occlusion, Specular, and Normal/Bump. In stock game it seems underused, and it is only employed for the mapping of AO maps or normal maps on a few objects. I couldn't find any example of it being used for specular mapping (neither in stock nor in modded files), but we can try :hmm2:

gap 07-25-17 12:43 PM

Our first lighthouse is not finished yet, but I am making plans for the next one. :D
It seems that with the Phare de la Vieille we will have a foghorn in game. To be precise, three blasts separated by a 1 minut interval:

http://enezsun.chez-alice.fr/Phares/Vielle.htm

BTW, I am trying to locate the diaphone on pictures available from the web, (so that I can model something similar and place it correctly within the lighthouse model) but I cannot find it. Maybe, in recent times, it has been replaced with some electrical device :hmmm:

Quote:

Originally Posted by Kendras (Post 2501743)
I let you compare between the SH3 map, and the real depth map :

http://i.imgur.com/mFyLFn5.png

http://i.imgur.com/2yajPpJ.png

Should we edit the SHIII terrain so to add the Pointe du Raz and Chausée de Sein in game?

https://upload.wikimedia.org/wikiped...sseedesein.png

From your screenshot of the ME map, I don't see them simulated in game. Both La Vieille and La Plate lay on the offshore extension of the Pointe du Raz with a sea depth ranging from ca. -10 to -14 m between the two lighthouses (measured in Gooogle Earth). In game, the depth of both locations is -17 which is reasonably close, but maybe we can do better, and recreate the submerged ridges as closely as possible with the limited resolution of SHIII's depth map :O:

Kendras 07-25-17 02:01 PM

Quote:

Originally Posted by gap (Post 2502625)
Should we edit the SHIII terrain so to add the Pointe du Raz and Chausée de Sein in game?

https://upload.wikimedia.org/wikiped...sseedesein.png

From your screenshot of the ME map, I don't see them simulated in game. Both La Vieille and La Plate lay on the offshore extension of the Pointe du Raz with a sea depth ranging from ca. -10 to -14 m between the two lighthouses (measured in Gooogle Earth). In game, the depth of both locations is -17 which is reasonably close, but maybe we can do better, and recreate the submerged ridges as closely as possible with the limited resolution of SHIII's depth map

I would like to correct all the sea depth of the area which is on the map I've posted. :O:

How can you modifiy the sea depth / terrain altitude with terrain editor ? I've never used it. Do you have to just change the color ? Is it a grey scale ?


All times are GMT -5. The time now is 08:00 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.