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)
-   -   What could the TMAP-chunk be? (https://www.subsim.com/radioroom/showthread.php?t=105059)

Kaleun_Endrass 02-03-07 05:39 AM

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?

FIREWALL 02-03-07 06:17 AM

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. :yep:
So hang in there and the'll be here. Good luck and sink alot of ships :up:

Jimbuna 02-03-07 06:52 AM

Sorry mate :nope:

Welcome aboard kaleun :arrgh!:

Kaleun_Endrass 02-03-07 08:07 AM

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.

ref 02-03-07 10:52 AM

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

Kaleun_Endrass 02-03-07 12:19 PM

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 :cry: )

ref 02-03-07 07:04 PM

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

DivingDuck 02-09-07 09:44 AM

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 :cry: )

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.

http://img223.imageshack.us/img223/6/cr001ei8.jpg

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

ref 02-09-07 09:56 AM

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

DivingDuck 02-09-07 11:05 AM

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

ref 02-09-07 12:01 PM

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

DivingDuck 02-09-07 01:24 PM

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

Anvart 02-10-07 04:09 PM

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).

Madox58 02-10-07 08:33 PM

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.

ref 02-10-07 10:50 PM

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


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