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 09-30-11, 10:32 PM   #31
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by privateer View Post
Here's the King George's AO texcoords extracted. (no granny2.dll was harmed during the extraction! ).
ok I don't know much about AO maps but I'm learning. That image above looks more like a .dds file. Are you saying the second set of texture coordinates are in fact a Vector3 array? It appears that triangles are being defined in that picture.....or is that a 2D render of the verticies texture coordinates?
TheDarkWraith is offline   Reply With Quote
Old 10-01-11, 03:28 AM   #32
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,547
Downloads: 26
Uploads: 3
Default

It's simply a render of the uv map for AO (vector2 array).

You have to define the right vertex structure. When more uv maps are defined on a model, a vertex structure has extra texcoords:

Vector3 Position;
Vector3 Normal;
Vector2 UV;
Vector2 UV_AO;

In shader code you decide when to use and what you do with it (and not in program code). In the same way you need to provide bi/tangent normals for bump mapping. And of course need to pass the appropriate textures to the shader pipeline. See my shader for an example...

Hint:
VS_OUTPUT RenderSceneVS( float4 vPos : POSITION,
float3 vNormal : NORMAL,
float2 vTex0 : TEXCOORD0,
float2 vTex1 : TEXCOORD1,
uniform bool bWireFrame )
skwasjer is offline   Reply With Quote
Old 10-01-11, 03:42 AM   #33
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,547
Downloads: 26
Uploads: 3
Default

Quote:
Originally Posted by TheDarkWraith View Post
If you bought the SH5 game you have a license to all the files contained in it. As long as I don't modify any dlls or exe there is no legal ground for anyone to stand on. Furthermore since the app asks you to point it to your granny2.dll file it is using your licensed copy of it.
So you're saying you could take any program it's core files, reverse engineer it or use libraries from it, but as long as you don't distribute those files (since the user has them already) you are in the clear... Trust me, that won't stand in court. Anywhere. Even I 'touched' illegal grounds by simply looking at SH4's .ACT files but at least I did not use any game libraries...

Now if RAD doesn't care, good for you and SH5, but that doesn't make it legal.

But anyways, this is an old discussion I don't care getting into...

Last edited by skwasjer; 10-01-11 at 04:28 AM.
skwasjer is offline   Reply With Quote
Old 10-01-11, 07:51 AM   #34
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Quote:
Originally Posted by TheDarkWraith View Post
ok, I think I found something interesting in the King GeorgeV.gr2 file itself:

000176E0 01 01 01 01 01 01 01 01 00 00 00 00 50 6F 73 69 ............Posi
000176F0 74 69 6F 6E 00 00 00 00 4E 6F 72 6D 61 6C 00 00 tion....Normal..
00017700 54 61 6E 67 65 6E 74 00 42 69 6E 6F 72 6D 61 6C Tangent.Binormal
00017710 00 00 00 00 54 65 78 74 75 72 65 43 6F 6F 72 64 ....TextureCoord
00017720 69 6E 61 74 65 73 30 00 54 65 78 74 75 72 65 43 inates0.TextureC
00017730 6F 6F 72 64 69 6E 61 74 65 73 31 oordinates1

Basically it tells me the vertex layout:
Position
Normal
Tangent
Binormal
TextureCoordinates0
TextureCoordinates1
Most Models in SH5 use 64 bytes to define the data for one vertex.
MOST but not all!!
Look at the Large Costal Gun and you'll see a 76 byte data structure!!
It has DiffuseColor0 before the first set of Texcoords.
That throws 12 bytes in but I have no idea why that's there.

Open that GR2 with your program and since your useing the granny2.dll I would expect it to render properly.

I had to add to my script to export the vertex data to account for this extra info.
Basiclly I just ignore it for now.

Also, if you open the gun with Goblin and click to view wireframe?
Only the base will show in wireframe mode.
The Barrel and Turret won't. So the DiffuseColor0 is doing something at least in Goblin.

Last edited by Madox58; 10-01-11 at 08:18 AM.
  Reply With Quote
Old 10-01-11, 10:32 AM   #35
Alex
Dominant Wolf
 
Join Date: Nov 2006
Posts: 2,143
Downloads: 30
Uploads: 0
Default

Let me tell you that I'm lost in admiration for the amount of knowledge that a select few have gathered in the shadows on some subjects related to this game.



But let's get back on topic now.
__________________
Alex is offline   Reply With Quote
Old 10-01-11, 11:10 AM   #36
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,547
Downloads: 26
Uploads: 3
Default

Quote:
Originally Posted by privateer View Post
Most Models in SH5 use 64 bytes to define the data for one vertex.
MOST but not all!!
Look at the Large Costal Gun and you'll see a 76 byte data structure!!
It has DiffuseColor0 before the first set of Texcoords.
That throws 12 bytes in but I have no idea why that's there.

Open that GR2 with your program and since your useing the granny2.dll I would expect it to render properly.

I had to add to my script to export the vertex data to account for this extra info.
Basiclly I just ignore it for now.

Also, if you open the gun with Goblin and click to view wireframe?
Only the base will show in wireframe mode.
The Barrel and Turret won't. So the DiffuseColor0 is doing something at least in Goblin.
It can indeed be simply for editting/viewing/debugging purposes. Remember that SH3/4 had many 'dev-leftovers' too in the game files. But it can also be a base color for lighting. I really have no idea why so I'm just throwing out ideas I know from memory/earlier experience. You might get a clue from the shader files. Just check all vertex shaders and their input structures and see if you can 'match' the input with the vertex data that you get from GR2. If it's somewhere in there you can deduce what it's for by interpreting the shader code. If it's nowhere to be found you can probably simply ditch it... It's how I learned that uv3/4 in DAT-files are obsolete data.

Last edited by skwasjer; 10-01-11 at 11:24 AM.
skwasjer is offline   Reply With Quote
Old 10-01-11, 12:23 PM   #37
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by privateer View Post
Most Models in SH5 use 64 bytes to define the data for one vertex.
MOST but not all!!
Look at the Large Costal Gun and you'll see a 76 byte data structure!!
It has DiffuseColor0 before the first set of Texcoords.
That throws 12 bytes in but I have no idea why that's there.

Open that GR2 with your program and since your useing the granny2.dll I would expect it to render properly.
Yes it does because it only reads one texture coordinate. There is no granny vertex format defined that has this other channel:



If you use Microsoft's PE dumper and look at the exports you'll see all the granny vertex formats defined. They are kind of encrypted in their wording but you can make it out. i.e.: PNT332 would be position, normal, texture where position is 3 reals, normal is 3 reals, and texture is 2 reals.

Viewing this in wireframe is fine because I'm controlling the rendering and just setting the wireframe renderstate.

I've come to the conclusion that the game (and Goblin editor) doesn't really use the granny2.dll to 'read' the whole GR2 file. It only uses it to get information when it needs it. This would explain why it can access the other texture coordinates and other color information contained in the verticies.

Here are two vertex formats I know:
PWNT3432 - position (3 reals), Bone data (bone indicies - 4 ints, bone weights - 4 ints), normal (3 reals), texture coordinates (2 reals)
PWNGBT343332 - position (3 reals), Bone data (bone indicies - 4 ints, bone weights - 4 ints), normal (3 reals), tangent (3 reals), binormal (3 reals), texture coordinates (2 reals)

The Granny viewer is an excellent source of information. It tells you what the data type is for each value it reads right there on the screen!

Last edited by TheDarkWraith; 10-01-11 at 01:12 PM.
TheDarkWraith is offline   Reply With Quote
Old 10-01-11, 01:49 PM   #38
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,547
Downloads: 26
Uploads: 3
Default

From Granny SDK feature page: http://www.radgametools.com/granny/sdk.html

- programmatically access all maps, including specular, diffuse, ambient, self-illumination, bump, displacement, refraction, reflection, and many others

Quote:
I've come to the conclusion that the game (and Goblin editor) doesn't really use the granny2.dll to 'read' the whole GR2 file. It only uses it to get information when it needs it. This would explain why it can access the other texture coordinates and other color information contained in the verticies.
Yes, a(ny) file never has to be completely loaded. The beauty of pointers. Files generally start with some sort of TOC header to aid in this.
No, in that the game will bypass the granny library to get other data from GR2. That would be utterly idiotic. The game has to get the data in some way at some point and it definately uses Granny for it.

Last edited by skwasjer; 10-01-11 at 03:33 PM.
skwasjer is offline   Reply With Quote
Old 10-01-11, 02:33 PM   #39
Anvart
Admiral
 
Join Date: Jan 2006
Location: Russia ®
Posts: 2,492
Downloads: 122
Uploads: 1
Quote:
Originally Posted by privateer View Post
...
And SH5 does not do the CRC check.
Had SH5 used the CRC check?
We'd be screwed big time!!
Unless you fell back to an older granny2.dll
... but no probs to calculate it... and you know it.
******************************************
small intrigue:

__________________
Alex ®


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

Last edited by Anvart; 10-01-11 at 07:50 PM.
Anvart is offline   Reply With Quote
Old 10-01-11, 03:30 PM   #40
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Uh Oh!!!
  Reply With Quote
Old 10-01-11, 03:35 PM   #41
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,547
Downloads: 26
Uploads: 3
Default

In 3... 2... 1...
skwasjer is offline   Reply With Quote
Old 10-01-11, 04:38 PM   #42
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Looks like some people are having some wrong impressions here and we need to clear these up.

I do not imbed or include any version of any software with what I have created. It's a unique, one-off design from information I have gathered.

The app is useless unless the end-user points it to a granny2.dll. Thus I have no ties to any software but my own. Freedom of information baby, gotta love the USA's freedom of speech right.

Now I may abandon having the user point it to a granny2.dll once we completely map out the gr2 file structure. Like I said I know about 75% of the structure already, it's the remaining 25% that needs to be decoded. Work is already well underway on it from various sources. I do have to say the 010 Hex editor app is a priceless piece of software. It's structure editor is a god-send when mapping out a file.

Ok now back to business
TheDarkWraith is offline   Reply With Quote
Old 10-01-11, 05:44 PM   #43
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

I do agree that 010 is a fantastic Tool!


Well worth the $49.95 spent.
I now run the 3.2.2 version.
I consider it 'THE' Editor if you mean business!
  Reply With Quote
Old 10-01-11, 07:02 PM   #44
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by privateer View Post
I do agree that 010 is a fantastic Tool!


Well worth the $49.95 spent.
I now run the 3.2.2 version.
I consider it 'THE' Editor if you mean business!
Cost me $150 Money well spent though!

I've got another major update coming to the template file. Almost have the whole material section mapped out completely - extended data and all

that last update I sent I found a hack that works temporarily until the data can be defined more correctly
TheDarkWraith is offline   Reply With Quote
Old 10-01-11, 07:08 PM   #45
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Anvart has broken the CRC issue by the way.


$150?
Commercial is $129.95 and the Upgrade/Maintenance is $39.95 for commercial.
How did you get a $150.00 figure?

Last edited by Madox58; 10-01-11 at 07:27 PM.
  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 05:18 AM.


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.