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 02-11-07, 12:14 PM   #16
Anvart
Admiral
 
Join Date: Jan 2006
Location: Russia ®
Posts: 2,492
Downloads: 122
Uploads: 1
Default

Quote:
Originally Posted by ref
Quote:
Originally Posted by Anvart
Quote:
Originally Posted by ref
Most high end 3d programs have an option to prelight a scene, mostly used in games, you design the scene, add the lights and then "prelight" the scene, process which applies the light on the scene to the objects, generally on a vertex base, making them lighter or darker accordingly so when the game engine loads the object it takes into account the light you apply on your scene, and improving the light rendering quality without the need to render it in real time.

Ref
What do you speak about?
Interior have Light source (Ambient Light).
Yes, but if they use prelighted scenes they can simulate shadows/bright spots to enhance the room without increasing the number of lights in the scene.

Ref
You think, that it is in SH3?

Anvart is offline   Reply With Quote
Old 02-19-07, 06:41 AM   #17
Anvart
Admiral
 
Join Date: Jan 2006
Location: Russia ®
Posts: 2,492
Downloads: 122
Uploads: 1
Default

Quote:
Originally Posted by Anvart
Quote:
Originally Posted by ref
Quote:
Originally Posted by Anvart
Quote:
Originally Posted by ref
Most high end 3d programs have an option to prelight a scene, mostly used in games, you design the scene, add the lights and then "prelight" the scene, process which applies the light on the scene to the objects, generally on a vertex base, making them lighter or darker accordingly so when the game engine loads the object it takes into account the light you apply on your scene, and improving the light rendering quality without the need to render it in real time.

Ref
What do you speak about?
Interior have Light source (Ambient Light).
Yes, but if they use prelighted scenes they can simulate shadows/bright spots to enhance the room without increasing the number of lights in the scene.

Ref
You think, that it is in SH3?

Hi, Ref.
May be you speak about Selfillumination maps?
In NSS_Uboat7_CR.dat they are LM01.tga, LM02.tga, LM03.tga, LM04.tga and others.
These maps simulate the shined and shadow spots and are in Type13 blocks.
__________________
Alex ®


Moses said: "Don't create yourself an idol"...

Last edited by Anvart; 02-19-07 at 03:02 PM.
Anvart is offline   Reply With Quote
Old 02-19-07, 03:04 PM   #18
Anvart
Admiral
 
Join Date: Jan 2006
Location: Russia ®
Posts: 2,492
Downloads: 122
Uploads: 1
Default

Bump. Ref?
__________________
Alex ®


Moses said: "Don't create yourself an idol"...

Last edited by Anvart; 02-19-07 at 03:19 PM.
Anvart is offline   Reply With Quote
Old 02-22-07, 05:46 PM   #19
Kaleun_Endrass
Sparky
 
Join Date: Jan 2007
Location: Hannover, Germany
Posts: 158
Downloads: 39
Uploads: 0
Default

Hi,

I looked again at the TMAP chunk and I found out, that the 3 unsigned shortints are indices for the elements of the TxCoordArray (as I mentioned in an earlier post). That means, each vertex that is an element of the trianlge at TriangleArray[i] gets an additional texture coordinate. In pseudo-code it would look like this:

TriangleArray[i].V1.AddTxCoord( TxCoordArray[TMapDatChunkList[i].T1] );
TriangleArray[i].V2.AddTxCoord( TxCoordArray[TMapDatChunkList[i].T2] );
TriangleArray[i].V3.AddTxCoord( TxCoordArray[TMapDatChunkList[i].T3] );

So, I´m currently reconsidering the possibility that the TMAP stands for SmoothingGroups. I´m not an game engine developer but I guess that smoothing like 3dsmax renderings during runtime would be extremly slow and an easy way could be to display the same texture at the mesh several times but with some offsets each time.
What do you guys think?
__________________
I hope alot of people will buy SHV. I will and I will mod it and play it. Keep in mind if we don´t buy it, the next SH title will look like this and you can look forward to a starfish addon...
Kaleun_Endrass is offline   Reply With Quote
Old 02-23-07, 07:07 AM   #20
Anvart
Admiral
 
Join Date: Jan 2006
Location: Russia ®
Posts: 2,492
Downloads: 122
Uploads: 1
Default

Quote:
Originally Posted by Kaleun_Endrass
Hi,

I looked again at the TMAP chunk and I found out, that the 3 unsigned shortints are indices for the elements of the TxCoordArray (as I mentioned in an earlier post). That means, each vertex that is an element of the trianlge at TriangleArray[i] gets an additional texture coordinate. In pseudo-code it would look like this:

TriangleArray[i].V1.AddTxCoord( TxCoordArray[TMapDatChunkList[i].T1] );
TriangleArray[i].V2.AddTxCoord( TxCoordArray[TMapDatChunkList[i].T2] );
TriangleArray[i].V3.AddTxCoord( TxCoordArray[TMapDatChunkList[i].T3] );

So, Iґm currently reconsidering the possibility that the TMAP stands for SmoothingGroups. Iґm not an game engine developer but I guess that smoothing like 3dsmax renderings during runtime would be extremly slow and an easy way could be to display the same texture at the mesh several times but with some offsets each time.
What do you guys think?
I think, that smoothing of models is AI hard code.
__________________
Alex ®


Moses said: "Don't create yourself an idol"...
Anvart is offline   Reply With Quote
Old 02-23-07, 07:16 AM   #21
ref
Grey Wolf
 
Join Date: Nov 2005
Location: Mar del Plata, Argentina
Posts: 871
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by Anvart
I think, that smoothing of models is AI hard code.
Maybe it's just one more thing to add in the unfinished features list.
They put it in the dats waiting for the programers to implement it but they didn't finish it in time, personally I've seen no difference with or without TMAP.

Ref
__________________
ref is offline   Reply With Quote
Old 02-23-07, 07:44 AM   #22
Anvart
Admiral
 
Join Date: Jan 2006
Location: Russia ®
Posts: 2,492
Downloads: 122
Uploads: 1
Default

Quote:
Originally Posted by ref
Quote:
Originally Posted by Anvart
I think, that smoothing of models is AI hard code.
Maybe it's just one more thing to add in the unfinished features list.
They put it in the dats waiting for the programers to implement it but they didn't finish it in time, personally I've seen no difference with or without TMAP.

Ref
I too.
__________________
Alex ®


Moses said: "Don't create yourself an idol"...
Anvart is offline   Reply With Quote
Old 02-23-07, 09:23 AM   #23
DivingDuck
Grey Wolf
 
Join Date: Jul 2006
Location: Germany
Posts: 902
Downloads: 10
Uploads: 1
Default

Moin,

as for the smoothing I remember having some problems in the past. If my remembrance is right an object appears "un"-smoothed ingame if one applies smoothing to an object and exports these smoothing groups when creating/exporting to wavefront *.obj file.

Cutting off the TMAP sections has an effect. The textures seem darker then. But it´s not that obvious since most of the interior is brought to the scene by separate objects that have their own TMAP. Take a closer look behind the handwheels.

Quote:
Originally Posted by Kaleun_Endrass
So, I´m currently reconsidering the possibility that the TMAP stands for SmoothingGroups.
Don´t think so. I suppose that it contains the value for light´s intensity for each triangle.

Regards,
DD
DivingDuck is offline   Reply With Quote
Old 04-05-07, 07:38 PM   #24
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,549
Downloads: 26
Uploads: 3
Default

Ok, let me share my findings. While all of you are partially right, my -be it premature- conclusion is the following: I think the additional maps do indeed refer to the texture index array.

I've analyzed the chunk, and found that most models seem to not use all of the texture coordinates (Vector2). So, basically, we have an texture index array that does not map into each and every texture coordinate array.
Now, if you think about it, this doesn't make sense. Why would there be more texture coordinates, then are actually used/mapped to each face.

This triggered me to search further. Enter the TMAP. Many of the indexes in the TMAP array (one or more maps possible), fill those holes! They refer to many of the remaining (yet unmapped) - but not all - texture coordinates. Great, so what now?

Well, it seems like the TMAP provides additional material info. For a ship with a wooden deck, the deck will cast/reflect light differently then the hull. Makes sense? But how does SH do this...

Many of the models have more than 1 texture. Ie.: take the Yamato: it has NBB_Yamato_T01.dds as the main texture. The NBB_Yamato_N01.dds is a normal map, and is used for bumpmapping. It is similar in layout to the T01 texture and could be directly mapped using the same texture coordinates. However, when we look at the NBB_Yamato_O01.dds texture, you can see it is a crazy image where the alpha channel is completely different from the RGB channels. It's very simple though, the alpha channel looks to me like the height map, and is also used with bumpmapping. The RGB channels however looks like a specular or diffuse map or maybe even another type of map they introduced to make a big surface look more unique by blending it. But since the layout of this texture is entirely different, we need new texture coordinates! Eureka? You tell me...

In case of interiors the same idea applies, although the TMAP appears to hold even more data. I haven't investigated this fully, but from what I see, interiors also use lightmaps, and maybe also both a specular and diffuse map. I will check this out later...

Anyway, I will try to use this data in my renderer (see http://forums.ubi.com/eve/forums/a/t...5/m/9841082745 and http://www.subsim.com/radioroom/showthread.php?t=110392) and see what the effects are (may take a few days/weeks though). I will try to use the TMAP indexes and only texture the ship with the RGB channel (without the alpha) of the xxx_O01.dds texture to see if my findings work.

If you have other ideas, think I'm absolutely wrong or whatever is on your mind, please keep 'm coming!
skwasjer is offline   Reply With Quote
Old 04-05-07, 07:42 PM   #25
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,549
Downloads: 26
Uploads: 3
Default

Oh and one other thing. Did you guys know about the NORM section that some models have trailing the TMAP? Looks like normals for each vertex, which will aid in smoothing out lighting/shadows...
skwasjer is offline   Reply With Quote
Old 04-05-07, 09:05 PM   #26
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,549
Downloads: 26
Uploads: 3
Default

Ok, well, so much for days/weeks:

The Yamato with the NBB_Yamato_T01.dds texture mapped using coordinates from the standard index array:


The Yamato again, this time textured with the RGB channel of NBB_Yamato_O01.dds. Note that I ONLY used the last TMAP texture index coordinates here, and completely ignored the standard texture index coordinate array.


See all the rust and deep shadows? TMAP solved... Well partially, now for interiors... Will look asap
skwasjer is offline   Reply With Quote
Old 04-06-07, 07:56 AM   #27
DivingDuck
Grey Wolf
 
Join Date: Jul 2006
Location: Germany
Posts: 902
Downloads: 10
Uploads: 1
Default

Hey Skwasjer,

that´s a pretty glamorous start. Hope there will be some more information I can use to create my own TMAP then. Good luck with your project. And in case you need someone to test it, I´m at your service.

Regards,
DD
DivingDuck is offline   Reply With Quote
Old 04-07-07, 04:16 PM   #28
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,549
Downloads: 26
Uploads: 3
Default

Quote:
Originally Posted by Anvart
Hi, All.
I already wrote my opinion. Repeat once again:

Description.
- TMAP – Label 4 bytes
- txtrType – 2 bytes unsigned short Textural Map Type (additional texture in Type13 chunk, for example, LightMap ...LM.tga)
- triFacesNum * (3 * Vt (unsigned short 2 bytes)) Textural Vertexes sequence for each face.

No, this is wrong. The 2 bytes after the header mean something else. Actually, Kaleun_Endrass already posted the correct structure layout in the first post of this thread. He just didn't completely interpret the data right.

TMAP - 4 bytes
mapCount - 1 byte

following this is a 'mapCount' number of structures of:

type - 1 byte, probably type of map. Most common value = 2 = SelfIllum map. Also found values of 3 and 4.
ushort[trisCount * 3] - 6 bytes * trisCount

If you use your structure, you would miss any additional texture coordinate maps. Most models only have one map so you wouldn't have a problem, but hey, we're after the correct data structure here...
It's good that you already had a close understanding of the layout of this data section, but from all the info I have gathered, everybody was a bit wrong along the line or hadn't been able to fully prove what the data was there for. Alot of guesses were in the right direction, which was great help for me to be able to prove it.

I will determine what the other types are for asap, specifically for interiors.
skwasjer is offline   Reply With Quote
Old 04-07-07, 06:22 PM   #29
Anvart
Admiral
 
Join Date: Jan 2006
Location: Russia ®
Posts: 2,492
Downloads: 122
Uploads: 1
Default

Quote:
Originally Posted by skwasjer
No, this is wrong. The 2 bytes after the header mean something else. Actually, Kaleun_Endrass already posted the correct structure layout in the first post of this thread. He just didn't completely interpret the data right.

TMAP - 4 bytes
mapCount - 1 byte

following this is a 'mapCount' number of structures of:

type - 1 byte, probably type of map. Most common value = 2 = SelfIllum map. Also found values of 3 and 4.
ushort[trisCount * 3] - 6 bytes * trisCount

If you use your structure, you would miss any additional texture coordinate maps. Most models only have one map so you wouldn't have a problem, but hey, we're after the correct data structure here...
It's good that you already had a close understanding of the layout of this data section, but from all the info I have gathered, everybody was a bit wrong along the line or hadn't been able to fully prove what the data was there for. Alot of guesses were in the right direction, which was great help for me to be able to prove it.

I will determine what the other types are for asap, specifically for interiors.
:rotfl:
__________________
Alex ®


Moses said: "Don't create yourself an idol"...
Anvart is offline   Reply With Quote
Old 04-08-07, 05:27 AM   #30
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,549
Downloads: 26
Uploads: 3
Default

Yes? I don't understand...
skwasjer 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 01:01 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.