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-03-07, 05:39 AM   #1
Kaleun_Endrass
Sparky
 
Join Date: Jan 2007
Location: Hannover, Germany
Posts: 158
Downloads: 39
Uploads: 0
Default What could the TMAP-chunk be?

Hi,

Iīve found out the structure of the TMAP-chunk but I couldīnt figure out, what it is for.

The structure is as follows (ntris is the number of Triangles the mesh is build of):

4x char............."TMAP"
1x byte.............number of maps
....here follow the maps, each consisting of:
1x byte.................maybe a group number if you consider TMAP as a SmoothGroup
ntris * 6 * bytes.....I believe itīs actually "ntris * 3 * WORD"

So, a single TMapDatChunk (I named it that way) encapsulates 3 unsigned shortint. I named them T1, T2 and T3 because they have something todo with the triangles of the mesh. As I looked at the values, I could see that it isnīt an index to a specific triangle because the values can get higher than ntris.

Has anyone an idea what TMAP could be?
Kaleun_Endrass is offline   Reply With Quote
Old 02-03-07, 06:17 AM   #2
FIREWALL
Eternal Patrol
 
Join Date: Mar 2006
Location: CATALINA IS. SO . CAL USA
Posts: 10,108
Downloads: 511
Uploads: 0
Default

Quote:
Originally Posted by Kaleun_Endrass
Hi,

Iīve found out the structure of the TMAP-chunk but I couldīnt figure out, what it is for.

The structure is as follows (ntris is the number of Triangles the mesh is build of):

4x char............."TMAP"
1x byte.............number of maps
....here follow the maps, each consisting of:
1x byte.................maybe a group number if you consider TMAP as a SmoothGroup
ntris * 6 * bytes.....I believe itīs actually "ntris * 3 * WORD"

So, a single TMapDatChunk (I named it that way) encapsulates 3 unsigned shortint. I named them T1, T2 and T3 because they have something todo with the triangles of the mesh. As I looked at the values, I could see that it isnīt an index to a specific triangle because the values can get higher than ntris.

Has anyone an idea what TMAP could be?
Hi K E First off Welcome Aboard.

I wish I knew what your even talking about, Sorry I'm no help but,
there's alot of great people here who can answer your questions.
So hang in there and the'll be here. Good luck and sink alot of ships
__________________
RIP FIREWALL

I Play GWX. Silent Hunter Who ???
FIREWALL is offline   Reply With Quote
Old 02-03-07, 06:52 AM   #3
Jimbuna
Chief of the Boat
 
Jimbuna's Avatar
 
Join Date: Feb 2006
Location: 250 metres below the surface
Posts: 190,539
Downloads: 63
Uploads: 13


Default

Sorry mate

Welcome aboard kaleun
__________________
Wise men speak because they have something to say; Fools because they have to say something.
Oh my God, not again!!

Jimbuna is offline   Reply With Quote
Old 02-03-07, 08:07 AM   #4
Kaleun_Endrass
Sparky
 
Join Date: Jan 2007
Location: Hannover, Germany
Posts: 158
Downloads: 39
Uploads: 0
Default

Thanks for the welcome...

Ok, I need to give additional information for those who doesnīt know about the TMAP-chunk but could find an explanation what it could be.

The Silent Hunter III DAT-, ZON-, VAL-, SIM-, DSD-Files consists of chunks. There are several types. One of them is Type 1. That type encapsulates a 3d model. A "normal" 3d model has Vertices, Triangles and Texture Coordinates. Some type 1 chunks have the TMAP structure (as described in my earlier post) right after the VertexArray, TriangleArray and TxCoordArray.
My first guess was, that these data stands for smoothing the mesh, but that wouldnīt make much sense because one TMAP contains one 6-byte data structure for each triangle and a SmoothingGroups contains only information of those vertices/triangles that build a smoothed surface. If you take a look at the file description for the OBJ fileformat then Smoothing could be an explanation for the TMAP but still, why are information stored for each and every triangle - that doesnīt make sense?!
My second guess was, that the TMAP has something todo with multi-texturing but that doesnīt make sense either because you can find 3d models that uses three different materials but have only one TMAP. But if Iīm wrong with this, what are those unsigned shortints for?

Well, Iīll keep looking... maybe someone of you have an idea.
Kaleun_Endrass is offline   Reply With Quote
Old 02-03-07, 10:52 AM   #5
ref
Grey Wolf
 
Join Date: Nov 2005
Location: Mar del Plata, Argentina
Posts: 871
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by Kaleun_Endrass
Thanks for the welcome...

Ok, I need to give additional information for those who doesnīt know about the TMAP-chunk but could find an explanation what it could be.

The Silent Hunter III DAT-, ZON-, VAL-, SIM-, DSD-Files consists of chunks. There are several types. One of them is Type 1. That type encapsulates a 3d model. A "normal" 3d model has Vertices, Triangles and Texture Coordinates. Some type 1 chunks have the TMAP structure (as described in my earlier post) right after the VertexArray, TriangleArray and TxCoordArray.
My first guess was, that these data stands for smoothing the mesh, but that wouldnīt make much sense because one TMAP contains one 6-byte data structure for each triangle and a SmoothingGroups contains only information of those vertices/triangles that build a smoothed surface. If you take a look at the file description for the OBJ fileformat then Smoothing could be an explanation for the TMAP but still, why are information stored for each and every triangle - that doesnīt make sense?!
My second guess was, that the TMAP has something todo with multi-texturing but that doesnīt make sense either because you can find 3d models that uses three different materials but have only one TMAP. But if Iīm wrong with this, what are those unsigned shortints for?

Well, Iīll keep looking... maybe someone of you have an idea.
That's one of the few misteries remaining on dat file structures (along with the animation format), as far as I know nobody has been able to figure it out, in any case don't use obj file format as a reference, it's used by us because it's the easiest one to produce, if you look at the SH4 thread pictures you'll see that the devs use 3ds max for designing, so probably it's a 3ds feature.

Ref
__________________
ref is offline   Reply With Quote
Old 02-03-07, 12:19 PM   #6
Kaleun_Endrass
Sparky
 
Join Date: Jan 2007
Location: Hannover, Germany
Posts: 158
Downloads: 39
Uploads: 0
Default

Hi ref,

I know that the devs are using 3dsmax and as I first started working on the dat files in March 2005, I found alot of similarities between the 3d models in the dat files and the 3ds fileformat.
But none of the chunks of a 3ds file have a structure size as the TMAP has.
Based on the name I would guess itīs an additional texture map (for each triangle one RGB value - but I never heard of a game using 48bit textures)

There is really just one thing left I think the TMAP is for and thatīs SmoothingGroups but I canīt figure out how the 3 unsigned shortints or 6 bytes should built such a group and futhermore why each triangle of the mesh needs to be in this group...

Did anyone tried to delete the TMAP section of an unit and compared the both visual appearances in the game? Maybe thatīs one hint... (Iīm asking, because I canīt test any longer - Iīm nearly 1000 miles away from my copy )
__________________
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-03-07, 07:04 PM   #7
ref
Grey Wolf
 
Join Date: Nov 2005
Location: Mar del Plata, Argentina
Posts: 871
Downloads: 0
Uploads: 0
Default

I haven't had many time myself for research in the last months, too busy with GWX, as soon as we release the january (now february) patch I'll resume the work on some tools and research of some unknown stuff in sh3 that has potential for improvement/additions.

Ref
__________________
ref is offline   Reply With Quote
Old 02-09-07, 09:44 AM   #8
DivingDuck
Grey Wolf
 
Join Date: Jul 2006
Location: Germany
Posts: 902
Downloads: 10
Uploads: 1
Default

Moin,
Quote:
Originally Posted by Kaleun_Endrass
...
Did anyone tried to delete the TMAP section of an unit and compared the both visual appearances in the game? Maybe thatīs one hint... (Iīm asking, because I canīt test any longer - Iīm nearly 1000 miles away from my copy )
I did, by mistake. Iīm doing the coding for Urfischīs open hatch project. After several days of investigation Iīve found out that the self illumination seems to be controlled by this TMAP section. The problem lies with Pack3D. When importing an object this section getīs lost. Even the unchanged original command roon canīt be re-imported without loosing it. I hope Iīll get the point how to (re-)attach this section to newly imported objects soon.

As you can see in the screenie below the newly added compartment is kind of foggy.



Donīt get confused about the green ambient light. Iīve used this color for some testing purposes. And yes, the compartment is lacking of several polys. First coding, then eye candy.

Regards,
DD
DivingDuck is offline   Reply With Quote
Old 02-09-07, 09:56 AM   #9
ref
Grey Wolf
 
Join Date: Nov 2005
Location: Mar del Plata, Argentina
Posts: 871
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by DivingDuck
Moin,
I did, by mistake. Iīm doing the coding for Urfischīs open hatch project. After several days of investigation Iīve found out that the self illumination seems to be controlled by this TMAP section. The problem lies with Pack3D. When importing an object this section getīs lost. Even the unchanged original command roon canīt be re-imported without loosing it. I hope Iīll get the point how to (re-)attach this section to newly imported objects soon.
Maybe prelighting applied to each face?

Ref
__________________
ref is offline   Reply With Quote
Old 02-09-07, 11:05 AM   #10
DivingDuck
Grey Wolf
 
Join Date: Jul 2006
Location: Germany
Posts: 902
Downloads: 10
Uploads: 1
Default

Moin,
Quote:
Originally Posted by ref
Maybe prelighting applied to each face?
Ref
Sorry ref, donīt know what prelighting is.
Iīve altered the illumination data for the corresponding *.tga file. Seems that there is an effect. But I think the devs wouldnīt have made it that way for no reason.

Regards,
DD

Last edited by DivingDuck; 02-09-07 at 01:25 PM.
DivingDuck is offline   Reply With Quote
Old 02-09-07, 12:01 PM   #11
ref
Grey Wolf
 
Join Date: Nov 2005
Location: Mar del Plata, Argentina
Posts: 871
Downloads: 0
Uploads: 0
Default

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
__________________
ref is offline   Reply With Quote
Old 02-09-07, 01:24 PM   #12
DivingDuck
Grey Wolf
 
Join Date: Jul 2006
Location: Germany
Posts: 902
Downloads: 10
Uploads: 1
Default

Hi,
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
If so, the TMAP section is not necessary and may be skipped. That makes me hope Iīll reach the goal another way, just by overriding this chunk.

Regards,
DD
DivingDuck is offline   Reply With Quote
Old 02-10-07, 04:09 PM   #13
Anvart
Admiral
 
Join Date: Jan 2006
Location: Russia Ū
Posts: 2,492
Downloads: 122
Uploads: 1
Default

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).
Anvart is offline   Reply With Quote
Old 02-10-07, 08:33 PM   #14
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

I'll admit, most of the files I've been into do not have the TMAP
so this is just a thought.

I read a paper quite awhile back that explained different approaches
to the 3d matrix problems as applied to game engines.

I remember what was reffered to as the "3 Magic Vertices"
as an approach to solveing certian problems while rendering
a 3d object to screen, depending on what approach the game
engine uses to render.
  Reply With Quote
Old 02-10-07, 10:50 PM   #15
ref
Grey Wolf
 
Join Date: Nov 2005
Location: Mar del Plata, Argentina
Posts: 871
Downloads: 0
Uploads: 0
Default

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
__________________
ref 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:28 AM.


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.