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 12-30-11, 06:55 PM   #376
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by MLF View Post
I cannot run SH map viewer without erroring.

All in all I'm up the creek without a periscope which is a shame as this application looks like the works as far as adding new units, and modifying others.

Don't like the feeling I'm missing something...... What are the install instructions for the app - am I missing some dll or some-such.......

Regards

MLF
I'm still looking for the DbgView output from this...
TheDarkWraith is offline   Reply With Quote
Old 12-31-11, 12:42 AM   #377
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

In order to verify that the texture coordinates are being written/read correctly I coded in something to view them. These are the first set of texture coordinates for the NVV hull 03. Something doesn't look right as they seem displaced a little to the right and down (things just don't line up right like the door below)



I took the texture coordinates and subtracted 0.5f from X and added 0.5f to Y to get to screen coordinates (rendered as transformed primitives - thus already specified in screen space). I rendered them to a surface where the surface is the diffuse texture for NVV hull 03. I then saved this texture to a graphics stream and used that stream as input into creating an new image. The new window's background image was set to this image. I had the TextureLoader class save the texture (and thus the rendered surfaced) to file so I could display it here. Anyone have any ideas why it seems displaced?
TheDarkWraith is offline   Reply With Quote
Old 12-31-11, 02:50 PM   #378
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Okay figured out my problem. The problem was due to perspective projection of camera (and not setting the camera before rendering to surface!). To fix I rendered the texture to a full-screen quad and drew that, then I drew the texture coordinates. Since all of this was being rendered to a surface I had a perfect texture to display when it was done (I added some new buttons that allow you to view the texture coordinates for a mesh's diffuse or AO map):



I was also being stupid about how to render the texture coordinates. After sleeping on it I realized that since I'm using transformed (screen space) coordinates to render the texture coordinates I don't have to do anything but multiply the texture coordinates by the screen resolution (actually the render to surface dimensions since it's technically the screen during the rendering of them)

You can change the color of the rendered texture coordinates via button. You can also save this image to file (double click anywhere in window - it will save as the type you have specified under the misc tab for screenshots).

In the display window title bar is tells you the mesh name : the texture name (texture type)

This window is resizable by using mouse like all other windows in windows (starting size is 600 X 600)

I have noticed that some of the AO maps seem to be not correct. Looking at the NVV Hull 03 you can see some problems in it.

Last edited by TheDarkWraith; 12-31-11 at 03:36 PM.
TheDarkWraith is offline   Reply With Quote
Old 12-31-11, 06:19 PM   #379
TheBeast
The Old Man
 
Join Date: Jan 2010
Location: Lynnwood, WA
Posts: 1,533
Downloads: 876
Uploads: 23


Default

Could it be possible to Export Maps to Clipboard?
When working on skins it would be fantastic to have a layer showing where everything is located llike limber holes etc that is hidden prior to save.
__________________
Fear me! I am, TheBeastBelow

SHIV-MediaFire | SHV-MediaFire
TheBeast is offline   Reply With Quote
Old 12-31-11, 06:58 PM   #380
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by TheBeast View Post
Could it be possible to Export Maps to Clipboard?
When working on skins it would be fantastic to have a layer showing where everything is located llike limber holes etc that is hidden prior to save.
In what format? Guess I don't understand what you're asking

Are you looking for something like a mask? Like an alpha layer?
TheDarkWraith is offline   Reply With Quote
Old 12-31-11, 08:22 PM   #381
TheBeast
The Old Man
 
Join Date: Jan 2010
Location: Lynnwood, WA
Posts: 1,533
Downloads: 876
Uploads: 23


Default

Quote:
Originally Posted by TheDarkWraith View Post
In what format? Guess I don't understand what you're asking

Are you looking for something like a mask? Like an alpha layer?
Format could be BMP, PNG, TGA. Silent 3ditor by Skwas exports in PNG format.

Not sure if it is UV or AO Map but it is the map that shows what part of the texture image is being used.
__________________
Fear me! I am, TheBeastBelow

SHIV-MediaFire | SHV-MediaFire
TheBeast is offline   Reply With Quote
Old 12-31-11, 08:55 PM   #382
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by TheBeast View Post
Format could be BMP, PNG, TGA. Silent 3ditor by Skwas exports in PNG format.

Not sure if it is UV or AO Map but it is the map that shows what part of the texture image is being used.
So it shows the triangles only? Are the triangles in wireframe or are they solid? Is the information contained in an alpha layer or in the RGB channels?

I currently allow you to save the image shown though it's an app screenshot (it saves the whole window). The image is saved in whatever format is selected for screenshot under the misc tab. I could make it just save the rendered portion but then that would contain texture in it also. I guess I could add another button(s) - mask that would create 'masks' for the subsets.

Ran into another problem:

I currently coded the rendering of texture coordinates to allow you to render only the subsets shown (whatever subsets are checked in the meshes treeview for that mesh). It all works fine except for the second subset (if the mesh has more than 1 subset). The problem is those texture coordinates are outside the normal 0-1 boundary and I'm guessing they are supposed to wrap back around? I don't see where Granny defines a wrapping mode for the texture coordinates
TheDarkWraith is offline   Reply With Quote
Old 12-31-11, 09:21 PM   #383
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

int32 UVW Tiling
Materials::Extended data
  Reply With Quote
Old 12-31-11, 10:10 PM   #384
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by privateer View Post
int32 UVW Tiling
Materials::Extended data
I see says the blind man Now I have to play around with the different values to figure out what they mean.

@TheBeast:

Something like this for the 'mask':


There is no alpha encoding in this. Just what you see. I could probably code something to make the black transparent via the alpha channel.

TheDarkWraith is offline   Reply With Quote
Old 12-31-11, 10:43 PM   #385
TheBeast
The Old Man
 
Join Date: Jan 2010
Location: Lynnwood, WA
Posts: 1,533
Downloads: 876
Uploads: 23


Default

Quote:
Originally Posted by TheDarkWraith View Post
I see says the blind man Now I have to play around with the different values to figure out what they mean.

@TheBeast:

Something like this for the 'mask':

There is no alpha encoding in this. Just what you see. I could probably code something to make the black transparent via the alpha channel.
Yes that is it. You add that as the Top Layer in the texture you are working on to help guide placement of rust, scratches, etc.
Select the black color only of that layer and delete. You are left with just the green wireframe only allowing you to see layer(s) below to edit.
Save all layers in .PDN for PaintDontNet or .PSD for Photo Shop for future editing.
When you are ready to Save the texture, you simply hide that layer with the Wire Frame so it is not saved to finished image texture.
__________________
Fear me! I am, TheBeastBelow

SHIV-MediaFire | SHV-MediaFire
TheBeast is offline   Reply With Quote
Old 12-31-11, 10:45 PM   #386
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by TheBeast View Post
Yes that is it. You add that as the Top Layer in the texture you are working on to help guide placement of rust, scratches, etc.
When you are ready to Save the texture, you simply hide that layer so it is not saved to finished image texture.
So it needs transparency or not? If I don't have to code in an alpha channel that would be great
TheDarkWraith is offline   Reply With Quote
Old 12-31-11, 11:04 PM   #387
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

here's another question for everyone:

Usually texture coordinates are defined in the 0-1 range. You can exceed these ranges for special effects of if you want an image wrapped (values of 1+ and for every additional 1 after that cause x times wrapping).

When I display the texture coordinates do you want them all in one screen (all values in one screen) or do you want them split between screens (values 0-1 in one screen, values 1-2 in another screen, values -1-0 in another screen, etc)? The splitting between windows would be like how Wings3D shows texture coordinates that are outside the 0-1 range

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


Default

Let me show you the problems we face with these SH5 units:

NVV Hull03 subset 0:


NVV hull 03 subset 1:


I needed something visual to see what was going on with the texture coordinates. What you are seeing are the texture coordinates rendered based on their UV values. The UV values for X ranged from -1 to 9....yes 9!! (the AO maps are even worse) So you are seeing the same image tiled 10 times in the X direction and 10 times in the Y direction as the background that the texture coordinates were rendered on. Since subsets share the same texture coordinates that would be why subset 0 is still tiled 10 times in the X and Y directions. You may ask why did I have to tile the Y direction by the same amount as the X direction? To keep scale and so they were rendered correctly is why.

Now can someone explain to me why you would need to take texture coordinates any higher than 2? I just don't get it

This makes it rather difficult to show the texture coordinates on one 'page'. They have to be split up into multiple pages if one wanted to 'see' them

Here's v1.0.492.0 if you want to see these texture coordinates for yourself: http://www.gamefront.com/files/21141...v1_0_492_0_zip

Last edited by TheDarkWraith; 01-01-12 at 01:29 AM.
TheDarkWraith is offline   Reply With Quote
Old 01-01-12, 01:44 AM   #389
TheBeast
The Old Man
 
Join Date: Jan 2010
Location: Lynnwood, WA
Posts: 1,533
Downloads: 876
Uploads: 23


Default

Quote:
Originally Posted by TheDarkWraith View Post
So it needs transparency or not? If I don't have to code in an alpha channel that would be great
No Alpha channel required. Silent 3ditor didn't have one.
Once the texture has been added as layer the user can select global the background color that is not needed and delete it leaving wire frame in place.
__________________
Fear me! I am, TheBeastBelow

SHIV-MediaFire | SHV-MediaFire
TheBeast is offline   Reply With Quote
Old 01-01-12, 02:39 AM   #390
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Quote:
Originally Posted by TheDarkWraith View Post
Now can someone explain to me why you would need to take texture coordinates any higher than 2? I just don't get it
One trick many use when doing thier UV's is to take advantage of the Tiling so all the UV's don't cluter the main window while working.
Normally you correct this before sending it out to God knows where.
Many consider it sloppy work not to adjust the UV's to a 0 - 1 layout.
That does not seems to be the case more and more often now days.
Hard to say if this (SH5 UV's) was a time constrant cause or oversight.
  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 06:11 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.