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 05-19-12, 04:07 PM   #1
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Looks like my VIIA sub is a real antique:



The hydrophone station is made of wood not metal

You now have the ability to change a mesh subset's material. Here I changed the material for the hydrophone station subset 1 to one that uses wood instead of metal.

The stipulation for changing a mesh subset's material is the materials you can choose from will have the same number of maps or a greater number of maps as the material you are replacing.

To change a mesh subset's material right click on the material node under the subset node in the mesh treeview.

@BIGREG - I'll send you a new test version here shortly so you can test this along with importing OBJ files that have different vertice counts from the original mesh
TheDarkWraith is offline   Reply With Quote
Old 05-19-12, 04:40 PM   #2
BIGREG
Grey Wolf
 
Join Date: Oct 2005
Location: Bretagne-FRANCE
Posts: 813
Downloads: 155
Uploads: 0
Default

Thank i try it tomorrow here is midnight
__________________
~~~~BigReg~BigRegOne~~~~



"Better watch where you do not go, because where were going, we will know what it is when we get there, and anyway, it will never be only water."

Proverbe Shadok
BIGREG is offline   Reply With Quote
Old 05-19-12, 07:10 PM   #3
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Some new changes to upcoming test version. So far these changes deal with selecting materials:



Notice that when selecting a new material it will tell you how many maps are defined in the title bar of the window. That number can be used in a comparison to the material you select. Notice also that the materials listed as available to select now also list how many maps defined. If number of maps defined is 0 then it tells you whether a texture is defined or not. In certain situations the number of maps defined in the material being replaced is compared against number of maps defined in material selected. If they are not equal then a dialog box like the above displays asking for confirmation from the user (this is to avoid inadvertantly selecting a material with fewer maps defined).

Since this selecting material window now can list materials with maps defined I had to change the code so that when you double click a material with maps defined it will show you all the textures for those maps:



This way you can see the textures of the material before committing to your selection

I can hear the question now "What happens if we select a material with fewer maps?" Answer: I'm not really sure. Try it and let me know. My best guess is the game will render those 'missing maps' as black or white.

Work continues...
TheDarkWraith is offline   Reply With Quote
Old 05-19-12, 11:58 PM   #4
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

More changes to the importer:



A strict import uses my first importer. A loose import uses my second importer (second importer does not require the vertex data to match the mesh's vertex data - you are free to add/remove verticies).

Now for the big changes: the only thing required to be in an OBJ file are vertices now If you do a loose import and you do not import:
- vertex data then the existing vertex data of the mesh will be used
- diffuse data - the texture coordinate 0 data will be null
- AO data - the texture coordinate 1 data will be null
- normal data - the normal data will be null

A strict import uses the existing data of the mesh thus none of those will be null unless they were previously null.

What this allows you to do now is read these different datas from different files. You could have the vertex data in one OBJ file, the diffuse data in another OBJ file, etc. Remember the only requirement is the OBJ file HAS to contain vertex data (vertices).

If the diffuse, AO, or normal data is bigger or smaller than the existing vertex data of the mesh it will be clipped or not used as appropriate.

TheDarkWraith is offline   Reply With Quote
Old 05-19-12, 11:58 PM   #5
BIGREG
Grey Wolf
 
Join Date: Oct 2005
Location: Bretagne-FRANCE
Posts: 813
Downloads: 155
Uploads: 0
Default

Hi

For the material all work great
But,for the meshes import ,yet i have the VT (vertex texture) do not correspond with the vertices



But, I'm sure you will succeed to settle this
__________________
~~~~BigReg~BigRegOne~~~~



"Better watch where you do not go, because where were going, we will know what it is when we get there, and anyway, it will never be only water."

Proverbe Shadok
BIGREG is offline   Reply With Quote
Old 05-20-12, 12:00 AM   #6
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by BIGREG View Post
Hi

For the material all work great
But,for the meshes import ,yet i have the VT (vertex texture) do not correspond with the vertices



But, I'm sure you will succeed to settle this
I'm sending you the newest version I've been working on here in a few (v1.1.175.1)
TheDarkWraith is offline   Reply With Quote
Old 05-20-12, 12:02 AM   #7
BIGREG
Grey Wolf
 
Join Date: Oct 2005
Location: Bretagne-FRANCE
Posts: 813
Downloads: 155
Uploads: 0
Default

Not too fast that I have time to make coffee
__________________
~~~~BigReg~BigRegOne~~~~



"Better watch where you do not go, because where were going, we will know what it is when we get there, and anyway, it will never be only water."

Proverbe Shadok
BIGREG is offline   Reply With Quote
Old 05-20-12, 12:05 AM   #8
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by BIGREG View Post
Not too fast that I have time to make coffee
Any files you have trouble importing please send to me so I can try them while watching what's going on in VS. I'll need to know what kind of import you were trying to do also (strict or loose) and what mesh you were trying to import into
TheDarkWraith is offline   Reply With Quote
Old 05-20-12, 12:09 AM   #9
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by TheDarkWraith View Post
The stipulation for changing a mesh subset's material is the materials you can choose from will have the same number of maps or a greater number of maps as the material you are replacing.
this no longer applies starting in v1.1.175.1. You can select any material you would like. If you select a material that has fewer maps than the existing material a dailog box will pop up warning you about this and asking for confirmation
TheDarkWraith is offline   Reply With Quote
Old 05-20-12, 03:57 AM   #10
BIGREG
Grey Wolf
 
Join Date: Oct 2005
Location: Bretagne-FRANCE
Posts: 813
Downloads: 155
Uploads: 0
Default

Room_CT.GR2 - TDC (mesh)



export from 3dWings : http://dl.dropbox.com/u/8655607/TDC_3dwings.zip

import in strict : error



in Loose : error




Export from 3dsMax : http://dl.dropbox.com/u/8655607/TDC_3dsMax10.zip
(show up the export stat)

in strict : error



in loose : error





i get try with other meshes

Edit: I have try with other meshes same errors
__________________
~~~~BigReg~BigRegOne~~~~



"Better watch where you do not go, because where were going, we will know what it is when we get there, and anyway, it will never be only water."

Proverbe Shadok

Last edited by BIGREG; 05-20-12 at 08:21 AM.
BIGREG is offline   Reply With Quote
Old 05-20-12, 11:16 AM   #11
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

@BIGREG - I was able to use your Wings3D files to figure out what was wrong with my code I fixed the errors and successfully imported your TDC from Wings3D (the app had to add 3 more vertices to the mesh's primary vertex data):



Now I think you have different materials assigned, no? That's the only reason I can see why the textures are messed up. As you can see from the screenshot above the app is rendering the TDC's subsets using the stock materials.

Your 3DS Max files are still screwed up. Your 3DS Max is splitting each subset into it's own object. Compare your Wings3D files to the 3DS Max ones and you'll see what I mean.

As far as one of the errors you posted above it appears you were not using the latest version I sent you. The number of texture coordinates != number of verticies check was totally removed and you should never see it.

I'm sending you the new GR2 file via PM so you can tell me if the import was correct or not

I was not able to use a strict import because your wings 3D files have 3 more verticies than the stock thus I had to use a loose import.
TheDarkWraith is offline   Reply With Quote
Old 05-20-12, 11:28 AM   #12
BIGREG
Grey Wolf
 
Join Date: Oct 2005
Location: Bretagne-FRANCE
Posts: 813
Downloads: 155
Uploads: 0
Default

Thank TDW i go to try it

For the 3dsMax file ,yes i have see with notepad+ ,he wrote it in subsets sections

for the 3 vertices in more ,that come from 3dwings,not from me ,that seem 3dwings add this vertices

for the version i use the 1.1.175.1

have try it,but the textures are changed,and i have send you with the original mapping ( with just one texture attribute change )

i get send you my conning tower ,but that will take time to upload (I have an internet connection, not really fast)
__________________
~~~~BigReg~BigRegOne~~~~



"Better watch where you do not go, because where were going, we will know what it is when we get there, and anyway, it will never be only water."

Proverbe Shadok

Last edited by BIGREG; 05-20-12 at 11:57 AM.
BIGREG is offline   Reply With Quote
Old 05-20-12, 11:37 AM   #13
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Here is a OBJ file format question that I'm pretty sure I know the answer to but just want to clarify:

in the face definitions (f) there can be 3 entries separated by /s. For example: f 456/210/341 507/3/54 823/65/1002. Let's take 456/210/341 and break it down:
456 = vertice index
210 = texture coordinate index
341 = normal index

Now what happens if the OBJ file has normal data but no texture coordinate data? How does the face definitions look like? Would they look like this:
f 456//341 507//54 823//1002

or like this:

f 456/341 507/54 823/1002

My understanding is the first one
TheDarkWraith is offline   Reply With Quote
Old 05-20-12, 11:39 AM   #14
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by BIGREG View Post
Thank TDW i go to try it

For the 3dsMax file ,yes i have see with notepad+ ,he wrote it in subsets sections

for the 3 vertices in more ,that come from 3dwings,not from me ,that seem 3dwings add this vertices

for the version i use the 1.1.175.1
A loose import can add/remove vertices as needed to the GR2 file so no worries

Why is 3DS Max doing these strange exports to OBJ files?

Does the Room_CT TDC render correctly with your materials?
TheDarkWraith is offline   Reply With Quote
Old 05-20-12, 12:11 PM   #15
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

I need to clarify something related to strict or loose imports: the OBJ files are required to have vertice data only BUT the number of subsets defined in the OBJ file (g) HAS to match the number of subsets in the original mesh. Though the number of subsets has to match you are free to change the indices of each subset

You would use a strict import when you don't want the number of vertices in the mesh to change. You would use a loose import when you do want the number of vertices defined for the mesh to change.

A strict import uses my first importer I wrote. A strict import does not allow the app to allocate/deallocate space in the GR2 file. A loose import uses my second importer I wrote. A loose import allows the app to allocate/deallocate space in the GR2 file as needed.
TheDarkWraith 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 04:49 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Copyright © 1995- 2026 Subsim®
"Subsim" is a registered trademark, all rights reserved.