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, 02:55 PM   #1741
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

  Reply With Quote
Old 02-03-13, 04:00 PM   #1742
Kaicokid
Watch
 
Join Date: Dec 2009
Posts: 20
Downloads: 91
Uploads: 0
Default

Lovely stuff.
Kaicokid is offline   Reply With Quote
Old 02-03-13, 08:56 PM   #1743
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Updated the app so that it can recognize more map usages such as those defined in that Augustus.GR2 file. I also updated the app so that if it finds a map usage it doesn't know it will simply ignore it (before it threw an error). That Augustus.GR2 file exposed some major errors in my app that I also fixed. There is one 'error' though that I cannot get my head around.

This 'error' is a rendering error and it's due to not reading the vertices correctly. The vertex component names are not unfamiliar and I've loaded SH5 GR2 files that contain the same 7 vertex component names defined. The problem is this Augustus.GR2 file has X,Y, and Z texture coordinates! I cannot find where the GR2 file defines that the vertex data contains a Z texture coordinate. Once I can figure that out I will be able to read the vertex data correctly and it will render correctly.

So yes this means I was able to successfully open a previously compressed GR2 file with the app and render it Now to figure out and fix this 'error'...
TheDarkWraith is offline   Reply With Quote
Old 02-03-13, 08:59 PM   #1744
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   #1745
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
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   #1746
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   #1747
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
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   #1748
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   #1749
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
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   #1750
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
Old 02-04-13, 05:34 AM   #1751
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

just got a good render of the Augustus.GR2 file. All my changes worked Can't post any pictures because subsim says I've exceeded my total album limit We have an album limit?
TheDarkWraith is offline   Reply With Quote
Old 02-04-13, 06:06 AM   #1752
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
just got a good render of the Augustus.GR2 file.
Cool


Quote:
Originally Posted by TheDarkWraith View Post
All my changes worked Can't post any pictures because subsim says I've exceeded my total album limit We have an album limit?
Try using imageshack or photobucket
gap is offline   Reply With Quote
Old 02-04-13, 06:59 AM   #1753
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default GR2 Editor bug or DirectX problem on my system?

When I try editing any of the GR2's contained in the Objects/Guns folder, this is what happens when I select (left click) a checked bone, or viceversa, when I check a selected bone:



What's that diamond rendered around the bone?

The Windows error message says, more or less:

Unmanaged exception in a component of the application, bla bla.
Object reference not set to an instance of an object

Details:

Code:
************** Testo dell'eccezione **************
System.NullReferenceException: Riferimento a un oggetto non impostato su un'istanza di oggetto.
   in TheDarkWraith.SilentHunter5.GR2EditorViewer.GetSelectedItemCanScaleRotateTranslate(Boolean& canscale, Boolean& canrotate, Boolean& cantranslate)
   in TheDarkWraith.SilentHunter5.GR2EditorViewer.SetCameraLocked(Boolean cameravalue, Boolean xaxisvalue, Boolean yaxisvalue, Boolean zaxisvalue)
   in TheDarkWraith.SilentHunter5.GR2EditorViewer.SetSelectedItem(enumSelectedItem si, Object& item)
   in TheDarkWraith.SilentHunter5.GR2EditorViewer.tvBones_AfterCheck(Object sender, TreeViewEventArgs e)
   in System.Windows.Forms.TreeView.OnAfterCheck(TreeViewEventArgs e)
   in System.Windows.Forms.TreeView.WndProc(Message& m)
   in System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   in System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   in System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Assembly caricati **************
mscorlib
    Versione assembly: 2.0.0.0
    Versione Win32: 2.0.50727.5466 (Win7SP1GDR.050727-5400)
    Base di codice: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
GR2EditorViewer
    Versione assembly: 1.1.285.1
    Versione Win32: 1.1.285.1
    Base di codice: file:///C:/Ubisoft/Silent%20Hunter%205/TDW_GR2EditorViewer_v_1_1_285_1/GR2EditorViewer.exe
----------------------------------------
System.Windows.Forms
    Versione assembly: 2.0.0.0
    Versione Win32: 2.0.50727.5467 (Win7SP1GDR.050727-5400)
    Base di codice: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Versione assembly: 2.0.0.0
    Versione Win32: 2.0.50727.5467 (Win7SP1GDR.050727-5400)
    Base di codice: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Versione assembly: 2.0.0.0
    Versione Win32: 2.0.50727.5467 (Win7SP1GDR.050727-5400)
    Base di codice: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Microsoft.DirectX.Direct3D
    Versione assembly: 1.0.2902.0
    Versione Win32: 9.05.132.0000
    Base di codice: file:///C:/Windows/assembly/GAC/Microsoft.DirectX.Direct3D/1.0.2902.0__31bf3856ad364e35/Microsoft.DirectX.Direct3D.dll
----------------------------------------
Microsoft.DirectX
    Versione assembly: 1.0.2902.0
    Versione Win32: 5.04.00.2904
    Base di codice: file:///C:/Windows/assembly/GAC/Microsoft.DirectX/1.0.2902.0__31bf3856ad364e35/Microsoft.DirectX.dll
----------------------------------------
Microsoft.DirectX.DirectInput
    Versione assembly: 1.0.2902.0
    Versione Win32: 5.04.00.2904
    Base di codice: file:///C:/Windows/assembly/GAC/Microsoft.DirectX.DirectInput/1.0.2902.0__31bf3856ad364e35/Microsoft.DirectX.DirectInput.dll
----------------------------------------
Microsoft.VisualC
    Versione assembly: 8.0.0.0
    Versione Win32: 8.00.50727.4927
    Base di codice: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualC/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualC.dll
----------------------------------------
System.Xml
    Versione assembly: 2.0.0.0
    Versione Win32: 2.0.50727.5420 (Win7SP1.050727-5400)
    Base di codice: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
mscorlib.resources
    Versione assembly: 2.0.0.0
    Versione Win32: 2.0.50727.5466 (Win7SP1GDR.050727-5400)
    Base di codice: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
System.Core
    Versione assembly: 3.5.0.0
    Versione Win32: 3.5.30729.5420 built by: Win7SP1
    Base di codice: file:///C:/Windows/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Configuration
    Versione assembly: 2.0.0.0
    Versione Win32: 2.0.50727.5420 (Win7SP1.050727-5400)
    Base di codice: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
Microsoft.DirectX.Direct3DX
    Versione assembly: 1.0.2902.0
    Versione Win32: 5.04.00.3900
    Base di codice: file:///C:/Windows/assembly/GAC/Microsoft.DirectX.Direct3DX/1.0.2902.0__31bf3856ad364e35/Microsoft.DirectX.Direct3DX.dll
----------------------------------------
System.Windows.Forms.resources
    Versione assembly: 2.0.0.0
    Versione Win32: 2.0.50727.5420 (Win7SP1.050727-5400)
    Base di codice: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_it_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------
Note that I can resume working on the file without apparent problem. Right clicking on bones and editing their properties works flawlessy, but when I close the bone editing window, the same error message pops up again.

Also note that the Update button it still not working as supposed (always greyed out, even after a bone change). I am nonetheless allowed to Store the changes without Updating them. When I want to save the changes on file, I am warned that there are changes not Updated and not Stored, but I can just ignore this message, since if I confirm that I want to continue with the save all the same, the next time I open the file my changes are there
gap is offline   Reply With Quote
Old 02-04-13, 01:38 PM   #1754
Ekmek
Mate
 
Join Date: Nov 2011
Posts: 53
Downloads: 4
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post
just got a good render of the Augustus.GR2 file. All my changes worked Can't post any pictures because subsim says I've exceeded my total album limit We have an album limit?

PURE GENIUS! and you did it so fast.

I look forward to the next build of the app!
Ekmek is offline   Reply With Quote
Old 02-04-13, 03:09 PM   #1755
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Ekmek View Post
PURE GENIUS! and you did it so fast.

I look forward to the next build of the app!
Here it is rendered:
http://www.mediafire.com/view/?rkffp7pip6e2ktv

There are a TON of bones defined in this GR2 file (> 1000). I would've rendered the bones also but because there are so many that's all you would basically see.

There are no textures because this GR2 file doesn't define any textures. It has materials but the maps of most of the materials aren't defined in the materials Furthermore, some of the maps have texture pointers but there are no textures defined in the GR2 file. Totally breaks all the rules I've figured out so far I have to figure out a way to overcome this

I still have lots of work to do on next version
TheDarkWraith 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:46 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.