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 01-01-12, 07:52 AM   #391
rocker_lx
Watch
 
Join Date: May 2005
Posts: 27
Downloads: 0
Uploads: 0
Default

Wow, nice tool.

So I tried to open :\Ubisoft\Silent Hunter 5\data\Submarine\NSS_Uboat7b\NSS_Uboat7b.GR2

GR2 editor showes "Loading..." for aprox 5 sec then writes
"c:\Ubisoft\Silent Hunter 5\data\Submarine\NSS_Uboat7b\NSS_Uboat7b.GR2 closed"
in the status message ??

I can succesfully open "C:\Ubisoft\Silent Hunter 5\data\Submarine\NSS_Uboat7b\Submarine Parts\Conning_7B_02.GR2"
I can also export this one to obj.

Although I'm not able to import it into lightwave. I can open the file in wings3d and then export to lightwave, which will then open the file.

I'm sure I'm just missing something here. Is it normal that the tool always compiles the shaders at launch?

Anyway I'm really impressed with your work, you sir are really talented.

Edit:
how to to rotate, zoom objects in viewer? I can't figue it out.

Last edited by rocker_lx; 01-01-12 at 08:42 AM.
rocker_lx is offline   Reply With Quote
Old 01-01-12, 10:44 AM   #392
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by rocker_lx View Post
Wow, nice tool.

So I tried to open :\Ubisoft\Silent Hunter 5\data\Submarine\NSS_Uboat7b\NSS_Uboat7b.GR2

GR2 editor showes "Loading..." for aprox 5 sec then writes
"c:\Ubisoft\Silent Hunter 5\data\Submarine\NSS_Uboat7b\NSS_Uboat7b.GR2 closed"
in the status message ??

I can succesfully open "C:\Ubisoft\Silent Hunter 5\data\Submarine\NSS_Uboat7b\Submarine Parts\Conning_7B_02.GR2"
I can also export this one to obj.

Although I'm not able to import it into lightwave. I can open the file in wings3d and then export to lightwave, which will then open the file.

I'm sure I'm just missing something here. Is it normal that the tool always compiles the shaders at launch?

Anyway I'm really impressed with your work, you sir are really talented.

Edit:
how to to rotate, zoom objects in viewer? I can't figue it out.
There are things that make you ho hmmm, and there are things that make you go hmmm even more. This is one of them (NSS_Uboat7b). With every mesh that is made the final thing that is done to it is it gets 'optimized'. It's really not optimized but a cheap way to get DirectX to assign attribute IDs to each vertice. I call this function:

mesh.OptimizeInPlace(MeshFlags.OptimizeAttributeSort | MeshFlags.OptimizeIgnoreVerts, adjac);

Usually it has no problems. But for this sub and some others it fails on attempt. So I said what if I call it again? I did and it worked. Things that make you go hmmm...

So the problem is fixed and I'll have a new version out shortly

I don't have a lightwave exporter. I currently only export to obj format.

Yes the tool always compiles the shaders at launch. This is because you are free to modify them at any time and recompile and use. Press the R key to recompile and use.

Press H to access help screen overlay.

To rotate click and hold left mouse button, move mouse.
To pan hold middle mouse button and move mouse
To zoom hold right mouse button and move mouse forward/backward

Once the camera is 'locked' things change. It depends on which axis of freedom you have granted and which axis's aren't locked. Press H key for help. The help screen is dynamic based on what you are currently doing. Once an object is locked the help screen will change.
TheDarkWraith is offline   Reply With Quote
Old 01-01-12, 11:55 AM   #393
rocker_lx
Watch
 
Join Date: May 2005
Posts: 27
Downloads: 0
Uploads: 0
Default

Ok, thanks.

I tried with the mouse to move and it didn't do anything, so I retried and now it works !? I wonder what I did wrong before.

I meant the .obj import into lightwave, it gave an error. You can't of course implement an export for every format. I also tried with XSI modtools opening the .obj which gave no error but the mesh was not shown, this could also be due that I don't know XSI enough.

Last edited by rocker_lx; 01-01-12 at 01:49 PM. Reason: incomplete sentence
rocker_lx is offline   Reply With Quote
Old 01-01-12, 01:35 PM   #394
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by rocker_lx View Post
Ok, thanks.

I tried with the mouse to move and it didn't do anything, so I retried and now it works !? I wonder what I did wrong before.

I meant the .obj import into lightwave, it gave an error. You can't of course implement an export for every format. I also tried with XSI modtools opening the .obj which gave no error but the mesh was not shown, this could also be due that I don't XSI enough.
I use Wings3D to verify that the exporter is working correctly. If Wings3D opens it up correctly then I know the exporter is working correctly
TheDarkWraith is offline   Reply With Quote
Old 01-01-12, 08:52 PM   #395
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

v1.0.493.0 released. See post #1

Shaders precompiled now so app starts up quick. You can still recompile if you want if you modify them.

Fixed problem with bounding sphere class that would prevent some units from loading

Fixed problem in Mesh class that would sometimes prevent the chosen file from being loaded (i.e. NSS_Uboat7b.GR2)

Fixed bugs in rendering of texture coordinates. I wasn't taking into account the possibility of V values exceeding 1 or being less than 0.

Did some cosmetic fixes to the window(s) shown when texture coordinates are rendered. Unmaximizing the window now returns it to it's former state. Double clicking the status bar at the bottom of the window sets the window back to it's default (starting) size (even if maximized).

Double clicking the rendered area of the rendered texture coordinates allows you to save the image.

Still have to 'cut' the rendered texture coordinates into subdivisions for those who U or V value(s) exceed 1 or are less than 0.

Re-enabled the import function. This is the first import style I coded (I'm still working on finishing the other importer). So previous restrictions apply when importing back into the GR2 file.

Fixed some bugs in the exporter. Bugs had to do with when the mesh had more than one subset and the first subset was disabled exceptions would be thrown.

Fixed some other minor bugs

TheDarkWraith is offline   Reply With Quote
Old 01-02-12, 01:18 AM   #396
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


v1.0.495.0 released. See post #1

The texture coordinates now render a tiled image showing you the 'overall' texture coordinates layout and then it breaks those down into individual windows (those grids that have a valid face rendered in them). This will bring a new age to skinning in SH5

This part I coded I had to pat myself on the back about. Rarely do I ever make something this slick

Planning your app really does pay off. I had about a month of planning of it and boy was I itchin to code. I'm not one to plan, I shoot from the hip usually.

Work continues on the new importer. If everything goes as planned I'll be patting myself on the back again Everything's looking good so far...

In this screen shot I had the NRTW loaded up. I had selected Hull 01 mesh. I asked the app to render texture coordinates 0 for subsets 0 and 1:


What we have is the overall texture coordinate layout in the topleft for subset 0. Those images to the right of it are the grid breakdowns.

In the bottom left we have the overall texture coordinate layout for subset 1. Those images to the right of it are the grid breakdown.

Notice that in the overall layout it tells you the grid structure.
In the grid breakdowns it tells you the U and V range of that grid.

I have to say that I did complain about texture coordinates being outside of the 0-1 range initially. Now I'm quite fond of the idea This makes skinning so much easier to do!

On the grid breakdowns: A grid will render if it has a valid face of the mesh rendered in it. This means you can get 'garbage' grids if the grid contains garbage but that garbage is a valid mesh face (as told by the mesh's indicies)

Every texture coordinate window is an individual. That means you can save each one if you want or discard it by clicking the red X in the upper right corner. To save double click anywhere in the rendered part.

Next thing I plan to do with the texture coordinates is let you select individual faces of a mesh (if fillmode selected has wireframe in it) by double clicking the face and exporting those. This will allow you to pinpoint exactly the place where you want to skin or change the texture. You'll be able to select multiple faces of a mesh (a face is a triangle of the mesh in case you didn't know). When you switch to a fillmode that has wireframe in it you are seeing the 'faces' of each mesh.

When you ask the app to render the texture coordinates by pressing 1 or 2 in the Show box of the meshes it will first ask you if you are creating a mask. A mask does not render the background image, it only renders the 2D texture coordinates. So if you say yes to this question you will only get the 2D texture coordinates (masks are used to make/edit skins). If you answer no to this question the material for the texture coordinates will be rendered then the 2D texture coordinates. Either way the name and path of the material for the texture coordinates being rendered in the window appears at the bottom of the window.


Last edited by TheDarkWraith; 01-02-12 at 01:43 AM.
TheDarkWraith is offline   Reply With Quote
Old 01-02-12, 05:33 AM   #397
urfisch
Sea Lord
 
Join Date: Mar 2005
Location: Deep down in Germany
Posts: 1,969
Downloads: 42
Uploads: 0
Default

good job, rb!
__________________


urfisch is offline   Reply With Quote
Old 01-02-12, 01:06 PM   #398
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

just realized that if you want to save the rendered texture coordinates to file you probably want to know what the current image size is. I'm going to add another status entry in the window's bottom status line that will tell you the current dimensions of the render area of the window. The optimum size is currently fixed at 1024 X 1024 as that is what I render the texture coordinates to (it's what the render to surface's 'backbuffer' is). I'll edit this with screenshot when added.

EDIT:

good thing I did this. I wasn't calculating a 'square' render area when you resized the window

Here's the change:


You'll notice something about the screenshot ability of the windows: ensure that dialog box isn't near the window being saved! This only happens when saving the full window. This will not happen and does not apply to saving render window as the render window is actually a texture being shown.

So you have the path to the material used with these texture coordinates on the bottom left. Double clicking this will set the window to the default starting size (render window area of 500 X 500).
On the bottom right you have the current render window size. As you resize the window this shows you the size of the render window, not the window itself! Double clicking this will set the render window to the optimum size (whatever size the render to surface's backbuffer was - currently fixed at 1024 X 1024). I might add the ability to select the size in case someone wants to make higher resolution skins. We'll see.

New version releasing soon with changes.

Face picker about complete but won't be in new version

Last edited by TheDarkWraith; 01-02-12 at 02:18 PM.
TheDarkWraith is offline   Reply With Quote
Old 01-02-12, 01:47 PM   #399
MLF
Weps
 
Join Date: Sep 2002
Location: SW France
Posts: 361
Downloads: 137
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post
I'm still looking for the DbgView output from this...
I tried PM'ing this to you but failed - too big. Not sure how to get it to you, really. Email?

I had dbgview output for V1.409 when it errored on loading a GR2 file - that's what I'm trying to send. However I cannot get any dbgview output for later versions which error on loading the app (before loading a GR2) and when moving the mouse.

Should I be able to run this app just by clicking on GR2EditorViewer.exe from any location on my PC?

Regards,

MLF
__________________
Je pense donc je fuis!
MLF is offline   Reply With Quote
Old 01-02-12, 01:54 PM   #400
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by MLF View Post
I tried PM'ing this to you but failed - too big. Not sure how to get it to you, really. Email?

I had dbgview output for V1.409 when it errored on loading a GR2 file - that's what I'm trying to send. However I cannot get any dbgview output for later versions which error on loading the app (before loading a GR2) and when moving the mouse.

Should I be able to run this app just by clicking on GR2EditorViewer.exe from any location on my PC?

Regards,

MLF
Zip it up first to decrease the size. Use 7Zip's brutal compresssion
Then you can upload the zipped file to www.megaupload.com or something similar and send me the link.

Yes you should be able to run the app by just clicking on the exe file from any location on your PC. Be sure that the location has the shaders folder with it

You do have at least .NET 3.5 installed right? I just thought of that as a possible reason why it won't load for you. The app also uses Microsoft's abandoned Managed DirectX (so stupid to abandon - XNA is a kiddy language and SlimDX is an option to use) so maybe forcing an install of DirectX9 from Microsoft's website might also cure it.
TheDarkWraith is offline   Reply With Quote
Old 01-02-12, 02:07 PM   #401
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

v1.0.496.0 released. See post #1

This fixes the problems and adds the features mentioned a few posts up
TheDarkWraith is offline   Reply With Quote
Old 01-02-12, 02:12 PM   #402
rocker_lx
Watch
 
Join Date: May 2005
Posts: 27
Downloads: 0
Uploads: 0
Default

Ok, this UV stuff makes my head turn. I have real problems grasping this UV space definition 0 to 1.

I noticed one small problem while exporting when I select "Yes" to specify save location, the save of the mtl and tga files fails. A small detail but perhaps you could fix this.

I can now successfully open the Uboat GR2 files, great.

I still have problems opening the obj file in lightwave. I opened it in another great free 3d editor called voidworld.
Download:
http://www.digitalfossils.com/
Newest builds:
http://voidworld.cmcproductions.co.u...board,2.0.html

When I resave to .obj in voidworld I can successfully open it in lightwave.
Voidworld has the advantage that it keeps the name of the UV maps intact.
Wings3d renamed them to Winds3dUV or something like that.

There I noted that the scale is huuuuuuuge, i had to resize the mesh, probably thats why I didn't see anything in XSI.


This is so cool.

Keep up the great work.
Here is a picture of it after import to Lightwave.
rocker_lx is offline   Reply With Quote
Old 01-02-12, 02:35 PM   #403
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by rocker_lx View Post
I noticed one small problem while exporting when I select "Yes" to specify save location, the save of the mtl and tga files fails. A small detail but perhaps you could fix this.

I still have problems opening the obj file in lightwave. I opened it in another great free 3d editor called voidworld.

When I resave to .obj in voidworld I can successfully open it in lightwave.
Voidworld has the advantage that it keeps the name of the UV maps intact.
I will look into the problem when you say yes to save location. I've yanked v1.0.496.0 until I look into this. Thanks for reporting

Can you send me the files produced by voidworld? I want to see what they do differently. If you can send me the files that lightwave makes I can probably code in an exporter for it also
TheDarkWraith is offline   Reply With Quote
Old 01-02-12, 03:22 PM   #404
rocker_lx
Watch
 
Join Date: May 2005
Posts: 27
Downloads: 0
Uploads: 0
Default

Hmm, Voidworld manages to sometimes screw up UV space, when I export with wings3d to obj the texture of the deck of the V7c41 is visible but with voidworld the texture mapping is lost. Also with wings3d the scale of the mesh is not of the charts after loading in Lightwave.

Thanks for your offer but I don't think that a Lightwave exporter is needed, import into GR2 editor is the thing which is needed.

BTW 3dsMax also seems to have problems reading the file, it just shows a line although the number of reported polygons and vertexes seems to match. The Wings3d file here also imports nicely. (But again I don't know max enough for being sure)

I will investigate some more. I already heard on other modding forums that .obj can be a bitch sometimes. Objects exported from cryengine2 editor for example also caused a lot of problems for some tools, but can normaly be fixed with some notepadding.

I will compare GR2 editor obj files with wings files, perhaps I can even rename the UV map via notepad in the wings3d file.

Edit:
Ha......
found it.... it's a localisation problem I guess, I opened the .obj file in notepad++ and compared with the wings3d .obj file GR2 Editor saves the data with wrong punctuation, probably due to regional settings in windows.

GR2 Editor
Quote:
# Exported by GR2Editor/Viewer v1.0.495.0
# Exported from GR2 file C:\Ubisoft\Silent Hunter 5\data\Submarine\NSS_Uboat7c41\NSS_Uboat7C41.GR2
#
mtllib NSS_Uboat7c41_hull.mtl
o NSS_Uboat7c41_hull
# 2 subsets, 11533 vertices, 15572 faces
v 0,018258890 -0,422333400 -0,012335560
v 0,018258890 -0,443254500 -0,012335970
Wings3d:
Quote:
# Exported from Wings 3D 1.4.1
mtllib deck-wings.mtl
o NSS_Uboat7c41_deck
#750 vertices, 677 faces
v -4.4170910e-2 0.19822740 3.18659600
v -8.0950110e-2 0.17744700 2.52884100
v -5.0900000e-7 9.4104280e-2 -3.31079400
The same Problem also caused voidworld to lose the UV mapping and scale the mesh to mega size. I guess voidworld was only taking the value behind the "," which gave those huge numbers.

Edit2:.
Yep I can successfully import the object file in lightwave when I change my separator to "." in my regional settings, but this causes an other error when loading NSS_Uboat7C41.GR2. (see screenshot)

After I click "OK" the GR2 file loads after a few seconds.

Edit3:

After trying again the bounding box error did not reappear.

Last edited by rocker_lx; 01-02-12 at 04:13 PM.
rocker_lx is offline   Reply With Quote
Old 01-02-12, 04:11 PM   #405
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Ah crap I did it again. I forgot about regional settings. I always forget about those of you not using the American decimal notation....I'll fix

So do I need to force decimal places as . or , ? Or let the app decide based on regional settings? I think I need to force the . decimal notation...
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 12:04 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.