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

Reply
 
Thread Tools Display Modes
Old 02-03-13, 08:59 PM   #1
Targor Avelany
Ace of the Deep
 
Join Date: Jan 2010
Location: Vancouver, BC, Canada
Posts: 1,183
Downloads: 225
Uploads: 0


Default

well, there is a slight problem I'm having with importing multiple subsets:

The original mesh has no problem, however all the subsets do.

In the GR2Viewer - all textures are proper. Even in GrannyViewer they are good. However, in game and goblin editor - the textures are all messed up.



And here's how it looks like in game


Targor Avelany is offline   Reply With Quote
Old 02-03-13, 09:43 PM   #2
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Targor Avelany View Post
well, there is a slight problem I'm having with importing multiple subsets:

The original mesh has no problem, however all the subsets do.

In the GR2Viewer - all textures are proper. Even in GrannyViewer they are good. However, in game and goblin editor - the textures are all messed up.
Interesting...can you send me your files for this so I can look them over when I have time?

Snooping around in Granny Viewer has shown me a big error in my app. When I read the PrimaryVertexData the first thing in each chunk of PrimaryVertexData is the VertexType. I really had no idea how to use/what this was for so I was reading the value (big error!). Granny Viewer showed me that some PrimaryVertexData had different sizes for bytes per vertex. How did it know this? The only logical way was that this VertexType was actually a pointer and that is why when I read this value it was always 0 (even for PrimaryVertexData with different number of bytes per vertex). So I checked to see if it was a pointer by having the app search for a pointer at the location of the VertexType. Sure enough it found one This is good. Now I have to figure out how to use this pointer and what data it points to (and how to use it). It obviously points to something that is going to ultimately tell me how many bytes per vertex this PrimaryVertexData has. Now it all makes perfect sense! I couldn't put my head around how there could be custom names in the vertex component names yet the Granny Viewer knew how many bytes to read for each vertex component name. Now I have a clue as to how it's doing it. This totally changes my app as I had previously hard coded how many bytes per vertex based on the vertex component name. Lots of work/changes to make...
TheDarkWraith is offline   Reply With Quote
Old 02-03-13, 10:03 PM   #3
Targor Avelany
Ace of the Deep
 
Join Date: Jan 2010
Location: Vancouver, BC, Canada
Posts: 1,183
Downloads: 225
Uploads: 0


Default

Quote:
Originally Posted by TheDarkWraith View Post
Interesting...can you send me your files for this so I can look them over when I have time?

Snooping around in Granny Viewer has shown me a big error in my app. When I read the PrimaryVertexData the first thing in each chunk of PrimaryVertexData is the VertexType. I really had no idea how to use/what this was for so I was reading the value (big error!). Granny Viewer showed me that some PrimaryVertexData had different sizes for bytes per vertex. How did it know this? The only logical way was that this VertexType was actually a pointer and that is why when I read this value it was always 0 (even for PrimaryVertexData with different number of bytes per vertex). So I checked to see if it was a pointer by having the app search for a pointer at the location of the VertexType. Sure enough it found one This is good. Now I have to figure out how to use this pointer and what data it points to (and how to use it). It obviously points to something that is going to ultimately tell me how many bytes per vertex this PrimaryVertexData has. Now it all makes perfect sense! I couldn't put my head around how there could be custom names in the vertex component names yet the Granny Viewer knew how many bytes to read for each vertex component name. Now I have a clue as to how it's doing it. This totally changes my app as I had previously hard coded how many bytes per vertex based on the vertex component name. Lots of work/changes to make...
You have a full pm box
Targor Avelany is offline   Reply With Quote
Old 02-03-13, 10:08 PM   #4
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Targor Avelany View Post
You have a full pm box
Post a link


Putting all of the pieces of the puzzle together:

[5148] PrimaryVertexData found at 0x3BE70 (0x3C038)
[5148] VertexType=0x0 0x3BE70 (0x3C038)

Instead of reading the value (which was 0x0) I had the app check for a pointer at this location and what do you know. Checked all the pointer data and data type definition data that the app spit out for the first PrimaryVertexData's VertexType pointer:

Pointer 8313: (type=pointer)
Data offset: 0x3BE70 (0x3C038) Section: 0x6 Value offset: 0x3920 (0xF8B14) File offset: 0x185AC (0x117060)
Pointer object data: Unknown type

Points to DataTypeDefinition:

DataType definition 457: (type=granny_real32)
Offset: 0x3920 (0xF8B14) Size: 0x20
Embedded string pointer offsetinsectiondata: 0x3924 (0xF8B18) Section: 0
Embedded string pointer offsetinsectionvalue: 0x4C490 (0x4C658) Embedded string: Position
Additional datatypedefinition offsetinsectiondata: N/A Section: N/A offsetinsectionvalue: N/A
Count: 3 Unknown: 0x0 Unknown2: 0x0 Unknown3: 0x0 Unknown4: 0x0
Additional data: N/A

DataType definition 458: (type=granny_uint8)
Offset: 0x3940 (0xF8B34) Size: 0x20
Embedded string pointer offsetinsectiondata: 0x3944 (0xF8B38) Section: 0
Embedded string pointer offsetinsectionvalue: 0x4C49C (0x4C664) Embedded string: BoneWeights
Additional datatypedefinition offsetinsectiondata: N/A Section: N/A offsetinsectionvalue: N/A
Count: 4 Unknown: 0x0 Unknown2: 0x0 Unknown3: 0x0 Unknown4: 0x0
Additional data: N/A

DataType definition 459: (type=uint8)
Offset: 0x3960 (0xF8B54) Size: 0x20
Embedded string pointer offsetinsectiondata: 0x3964 (0xF8B58) Section: 0
Embedded string pointer offsetinsectionvalue: 0x4C4A8 (0x4C670) Embedded string: BoneIndices
Additional datatypedefinition offsetinsectiondata: N/A Section: N/A offsetinsectionvalue: N/A
Count: 4 Unknown: 0x0 Unknown2: 0x0 Unknown3: 0x0 Unknown4: 0x0
Additional data: N/A

DataType definition 460: (type=granny_real32)
Offset: 0x3980 (0xF8B74) Size: 0x20
Embedded string pointer offsetinsectiondata: 0x3984 (0xF8B78) Section: 0
Embedded string pointer offsetinsectionvalue: 0x4C4B4 (0x4C67C) Embedded string: Normal
Additional datatypedefinition offsetinsectiondata: N/A Section: N/A offsetinsectionvalue: N/A
Count: 3 Unknown: 0x0 Unknown2: 0x0 Unknown3: 0x0 Unknown4: 0x0
Additional data: N/A

DataType definition 461: (type=granny_real32)
Offset: 0x39A0 (0xF8B94) Size: 0x20
Embedded string pointer offsetinsectiondata: 0x39A4 (0xF8B98) Section: 0
Embedded string pointer offsetinsectionvalue: 0x4C4BC (0x4C684) Embedded string: Tangent
Additional datatypedefinition offsetinsectiondata: N/A Section: N/A offsetinsectionvalue: N/A
Count: 3 Unknown: 0x0 Unknown2: 0x0 Unknown3: 0x0 Unknown4: 0x0
Additional data: N/A

DataType definition 462: (type=granny_real32)
Offset: 0x39C0 (0xF8BB4) Size: 0x20
Embedded string pointer offsetinsectiondata: 0x39C4 (0xF8BB8) Section: 0
Embedded string pointer offsetinsectionvalue: 0x4C4C4 (0x4C68C) Embedded string: Binormal
Additional datatypedefinition offsetinsectiondata: N/A Section: N/A offsetinsectionvalue: N/A
Count: 3 Unknown: 0x0 Unknown2: 0x0 Unknown3: 0x0 Unknown4: 0x0
Additional data: N/A

DataType definition 463: (type=granny_real32)
Offset: 0x39E0 (0xF8BD4) Size: 0x20
Embedded string pointer offsetinsectiondata: 0x39E4 (0xF8BD8) Section: 0
Embedded string pointer offsetinsectionvalue: 0x4C4D0 (0x4C698) Embedded string: TextureCoordinates0
Additional datatypedefinition offsetinsectiondata: N/A Section: N/A offsetinsectionvalue: N/A
Count: 3 Unknown: 0x0 Unknown2: 0x0 Unknown3: 0x0 Unknown4: 0x0
Additional data: N/A

DataType definition 464: (type=end_of_data_type_definition)
Offset: 0x3A00 (0xF8BF4) Size: 0x20
Embedded string pointer offsetinsectiondata: N/A Embedded string section: N/A
Embedded string pointer offsetinsectionvalue: N/A Embedded string: N/A
Additional datatypedefinition offsetinsectiondata: N/A Section: N/A offsetinsectionvalue: N/A
Count: 0 Unknown: 0x0 Unknown2: 0x0 Unknown3: 0x0 Unknown4: 0x0
Additional data: N/A

That tells me what I needed to know!
Position - has 3 values (3 X 4 bytes = 12)
BoneWeights - has 4 values (4 X 1 bytes = 4)
BoneIndicies - has 4 values (4 X 1 bytes = 4)
Normal - has 3 values (3 X 4 bytes = 12)
Tangent - has 3 values (3 X 4 bytes = 12)
Binormal - has 3 values (3 X 4 bytes = 12)
TextureCoordinates0 - has 3 values (3 X 4 bytes = 12)
Total bytes per vertex = 12 + 4 + 4 + 12 + 12 + 12 + 12 = 68 bytes (just as Granny Viewer says!!!!!!!) Mystery solved

And before anyone asks no you all don't have access to this data.

Last edited by TheDarkWraith; 02-03-13 at 10:38 PM.
TheDarkWraith is offline   Reply With Quote
Old 02-03-13, 10:10 PM   #5
Targor Avelany
Ace of the Deep
 
Join Date: Jan 2010
Location: Vancouver, BC, Canada
Posts: 1,183
Downloads: 225
Uploads: 0


Default

done and done

Last edited by Targor Avelany; 02-03-13 at 10:24 PM.
Targor Avelany is offline   Reply With Quote
Old 02-03-13, 10:17 PM   #6
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

got it. You can remove the link if you don't want others to have it
TheDarkWraith is offline   Reply With Quote
Old 02-04-13, 02:07 AM   #7
Targor Avelany
Ace of the Deep
 
Join Date: Jan 2010
Location: Vancouver, BC, Canada
Posts: 1,183
Downloads: 225
Uploads: 0


Default

Quote:
Originally Posted by TheDarkWraith View Post
got it. You can remove the link if you don't want others to have it
Awesome. Thanks you, sir.

Also, just remembered, when I tried adding bump or occlusion maps, the hull was stopping rendering. Everything else is there - but no hull (cause that is the only object I was adding those maps to)
Targor Avelany is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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 04:42 PM.


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