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-29-11, 05:10 PM   #1
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default GR2 Editor/Viewer/Extractor/Importer

For approximately the last 8 months I've been gathering information on the GR2 format. I've found info from the net and from this one magical place on the net dealing with QuArK. This one magical place has been a major source of the information I've attained about the GR2 format. Another huge source of information was the GrannyViewer app from RAD games (the 'maker' of the granny format - a free app from them). That app tells you everything that is contained in the GR2 file - the trick is figuring where the info displayed resides in the GR2 file. I used that app extensively in the making of this app. Last, but not least, Privateer provided the last missing piece to the puzzle when he released his GR2 template for the 010 editor. I couldn't figure out how to read the very beginning of the file and that template provided information that allowed me to figure it out.
The pointers contained in section 0 of the GR2 file will tell you everything you need to know to do what I've done.



The screenshot above shows NSS_Uboat7a (with hull mesh turned off to show rooms). All waypoints are shown also.

Since I have all this data and I know how to interpret it correctly I can do basically anything with it. An extractor will be coded in to allow you to extract meshes from the GR2 file into OBJ format (might even code it for Microsoft's X format also). I hope to also figure out how to import new items into the GR2 file via the app.

Now I know someone is going to say "We have the goblin editor and Granny viewer to see GR2 files graphically. Why reinvent the wheel?" And that would be a good and valid question. Here's why:
- If I can display the information I read from the file graphically and it renders correctly then I'm reading the file correctly. Most important.
- To do things that either of them can't do (picking, moving bones, rotating meshes, etc.)

For anyone that's curious:
- developed using Visual Studio 2008 C#
- currently uses DirectX fixed-function pipeline (I plan on converting it to the programmable pipeline [aka shaders] once everything is working). I use the fixed-function pipeline because it's easier to code initially. Goal is to get everything working then go back and polish.
- uses DirectX 9.0c for rendering (no OpenGL or anything like that)

current version v1.1.459.1: https://www.mediafire.com/?0c360d3g4jx3qah
NOTE: CURRENT VERSION IS IN ALPHA STATE. ENSURE TO BACKUP YOUR WORK BEFORE SAVING WITH APP!




In hopes of getting some open-source type thing going on here is the C# AntiGranny code file (old and outdated but still full of useful info). Since there was no participation in my open-source adventure I will not be updating the source code below anymore:
http://www.gamefront.com/files/20890...10_15_2011_zip

Last edited by TheDarkWraith; 08-23-14 at 04:33 PM.
TheDarkWraith is offline   Reply With Quote
Old 09-29-11, 05:16 PM   #2
THE_MASK
Ace of the deep .
 
THE_MASK's Avatar
 
Join Date: Jan 2006
Posts: 9,226
Downloads: 901
Uploads: 73


Default

Speechless
THE_MASK is offline   Reply With Quote
Old 09-29-11, 05:47 PM   #3
Echolot
Seasoned Skipper
 
Join Date: Mar 2010
Location: Berlin, Germany
Posts: 718
Downloads: 567
Uploads: 0
TheDarkWraith

Privateer

Subsim community

Great.

Echolot is offline   Reply With Quote
Old 09-29-11, 07:31 PM   #4
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Very Nice Mate!


I'm sure some of the information I have will help alot.
  Reply With Quote
Old 09-29-11, 08:34 PM   #5
Sailor Steve
Eternal Patrol
 
Sailor Steve's Avatar
 
Join Date: Nov 2002
Location: High in the mountains of Utah
Posts: 50,369
Downloads: 745
Uploads: 249


Default

Supercalifragilisticexpialidocious!

Not that I understand any of it, but I can see that it's awesome!
__________________
“Never do anything you can't take back.”
—Rocky Russo
Sailor Steve is offline   Reply With Quote
Old 09-29-11, 09:39 PM   #6
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

First texture render (lighting disabled):



As you can see I have more work to do on it. Not bad for first render with textures though! The textures and how they are defined in the GR2 file are somewhat confusing. You have a pointer that can point to the actual material or it could point to another pointer that can point to another pointer......so on and so forth I obviously don't have my pointers straight By looking at this graphically I can see that I'm not reading this part of the file correctly.
TheDarkWraith is offline   Reply With Quote
Old 10-11-11, 06:59 AM   #7
tonschk
Admiral
 
Join Date: Mar 2007
Posts: 2,200
Downloads: 172
Uploads: 0
Default

Quote:
Originally Posted by Echolot View Post
TheDarkWraith

Privateer

Subsim community

Great.


__________________
What we do in life echoes in Eternity
tonschk is offline   Reply With Quote
Old 10-16-12, 06:40 PM   #8
Ekmek
Mate
 
Join Date: Nov 2011
Posts: 53
Downloads: 4
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post


In hopes of getting some open-source type thing going on here is the C# AntiGranny code file (old and outdated but still full of useful info). Since there was no participation in my open-source adventure I will not be updating the source code below anymore:
http://www.gamefront.com/files/20890...10_15_2011_zip

Darkwraith,

This link is dead do you still have the source code?
Ekmek is offline   Reply With Quote
Old 11-13-12, 10:19 AM   #9
KarlSteiner
Bosun
 
Join Date: Jul 2004
Location: Ubi bene ibi patria
Posts: 65
Downloads: 257
Uploads: 0
Default please help me

Hi TDW and the others,

I am an old subsim fan since SHI (Silent Service) meanwhile I design vessels in low poly-design with MAX5.1/8. It was for sh3 a 3d-model of a small tractor steam tug and converted into sh3 by Rovi58 named NHDS2302. If the link is present no more Ican sent a vesion to you.

Reading all these posts about your editor I think I will try to do that with shV, now. The last version of your editor I got is: 1.167.1.
Because I was very ill the last months.

Please maybe you can send the actual version to me: carolussteiner@web.de

Best regards and
many thanks to all the other modders!

Karl
KarlSteiner is offline   Reply With Quote
Old 11-13-12, 10:37 AM   #10
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 KarlSteiner View Post
Hi TDW and the others,

I am an old subsim fan since SHI (Silent Service) meanwhile I design vessels in low poly-design with MAX5.1/8. It was for sh3 a 3d-model of a small tractor steam tug and converted into sh3 by Rovi58 named NHDS2302. If the link is present no more Ican sent a vesion to you.

Reading all these posts about your editor I think I will try to do that with shV, now. The last version of your editor I got is: 1.167.1.
Because I was very ill the last months.

Please maybe you can send the actual version to me: carolussteiner@web.de

Best regards and
many thanks to all the other modders!

Karl
Very nice!
Look at http://www.subsim.com/radioroom/show...70#post1942270 this thread; I think it will be what you are looking for.
Targor Avelany is offline   Reply With Quote
Old 01-04-13, 07:39 PM   #11
KarlSteiner
Bosun
 
Join Date: Jul 2004
Location: Ubi bene ibi patria
Posts: 65
Downloads: 257
Uploads: 0
Default

Hi Targor Avelany

many thank for your kindly tipp.

Best regards

Karl
KarlSteiner is offline   Reply With Quote
Old 01-14-13, 01:54 PM   #12
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Link at post #1 changed to reflect newest version - v 1.1.277.1
TheDarkWraith is offline   Reply With Quote
Old 01-14-13, 02:37 PM   #13
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
Link at post #1 changed to reflect newest version - v 1.1.277.1
gap is offline   Reply With Quote
Old 01-14-13, 04:44 PM   #14
silentmichal
Frogman
 
Join Date: Aug 2011
Location: Poland, my homeland.
Posts: 304
Downloads: 241
Uploads: 0
Quote:
Originally Posted by TheDarkWraith View Post
Link at post #1 changed to reflect newest version - v 1.1.277.1

TheDarkWraith, GREAT!!! I'll test new version - of course I'm still waiting for PIFT by Privateer . Maybe you'll repair bug with AO-texture coordonates? But, THANK YOU


EDIT

Unfortunatelly, I also have this bug - I loaded file, and... gray background . TDW, If you have any time, please repair it .


EDIT 2


When I selected "Fixed mode" in rendering tab - it's OK, but without textures - If I do sth bad, please give me tips.


EDIT 3

Sorry for my fail , about gray background - everything is OK - I had to change SH5 install folder .
__________________
Dining place in Silent Hunter 5? NOW it's possible ! My graphics mod available here:
http://www.subsim.com/radioroom/showthread.php?t=200862

Last edited by silentmichal; 01-15-13 at 09:58 AM.
silentmichal is offline   Reply With Quote
Old 01-21-14, 03:09 AM   #15
Anvart
Admiral
 
Join Date: Jan 2006
Location: Russia ®
Posts: 2,492
Downloads: 122
Uploads: 1
Quote:
Originally Posted by TheDarkWraith View Post
... current version v1.1.374.1: removed due to major problem in allocating vertices code ...

Obviously, the theme became lifeless... suddenly.
__________________
Alex ®


Moses said: "Don't create yourself an idol"...
Anvart 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 09:36 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.