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-22-14, 09:45 PM   #1
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
Default

another weirdness that should be addressed:

http://www.subsim.com/radioroom/show...&postcount=149
http://www.subsim.com/radioroom/show...&postcount=154

This time I had exported some of the crates from small_generic_01.GR2, edited their height in wings, and imported them back in the same file (strict import, only vertices coordinates imported, keep existing Norma/AO data yes). Their material was getting corrupt. The one cure I was able to find, was setting a new material and discarding the old one.
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 01-22-14, 10:03 PM   #2
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Where are the TGAs/DDSs for the barrage balloon?
TheDarkWraith is offline   Reply With Quote
Old 01-22-14, 10:08 PM   #3
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
Where are the TGAs/DDSs for the barrage balloon?
ops... sorry, I forgot about textures. You can get them from here
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 01-23-14, 01:37 AM   #4
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
ops... sorry, I forgot about textures. You can get them from here
Ok I finally got to the bottom of the problem with the barrage balloon and importing. I found a few very minor errors in the importer but that wouldn't cause the rendering problem.

Granny is a little inefficient (if you want to call it this) in the way it treats vertices. If you export any mesh from any of the SH5 GR2s you'll notice that it has a LOT of vertices defined. Why you may ask? Every vertice in Granny has it's own texture coordinate and might also have a normal defined. If a vertice has the same position data but different texture data then Granny needs another vertice for it.

Your barrage balloon has been optimized in it's vertices. By optimized I mean if two vertices were found to have the same positional data then the 'duplicate' was discarded. This is not good for Granny!

I had the importer track all the indices defined and if a duplicate indice was found then it checked to see if the texture coordinates were different for the two. What I found was what I thought: the indices are defining two vertices (it's actually the same index in the vertices) that have the same positional data but different texture data. My importer is then overwriting the vertices existing texture data (which was previously defined) with new texture data. This makes it appear that texture data is all hosed up.

How to fix? What I have to do is when a duplicate vertice is found (face definition defines a vertex index that has already been used) I have to clone it.

Last edited by TheDarkWraith; 01-23-14 at 01:47 AM.
TheDarkWraith is offline   Reply With Quote
Old 01-23-14, 08:08 AM   #5
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post

Granny is a little inefficient (if you want to call it this) in the way it treats vertices. If you export any mesh from any of the SH5 GR2s you'll notice that it has a LOT of vertices defined. Why you may ask? Every vertice in Granny has it's own texture coordinate and might also have a normal defined. If a vertice has the same position data but different texture data then Granny needs another vertice for it.

Your barrage balloon has been optimized in it's vertices. By optimized I mean if two vertices were found to have the same positional data then the 'duplicate' was discarded. This is not good for Granny!

I had the importer track all the indices defined and if a duplicate indice was found then it checked to see if the texture coordinates were different for the two. What I found was what I thought: the indices are defining two vertices (it's actually the same index in the vertices) that have the same positional data but different texture data. My importer is then overwriting the vertices existing texture data (which was previously defined) with new texture data. This makes it appear that texture data is all hosed up.

How to fix? What I have to do is when a duplicate vertice is found (face definition defines a vertex index that has already been used) I have to clone it.
It makes perfect sense, but why 3ds max exports of the same ballon model, whose vertices are also optimized, are imported correctly by GR2 Editor?

Please have a look to the obj files below (kindly provided by Targor Avelany) to know what I mean:

https://www.mediafire.com/?2l6uew8aqxebk2y
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 01-23-14, 08:38 AM   #6
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
It makes perfect sense, but why 3ds max exports of the same ballon model, whose vertices are also optimized, are imported correctly by GR2 Editor?

Please have a look to the obj files below (kindly provided by Targor Avelany) to know what I mean:

https://www.mediafire.com/?2l6uew8aqxebk2y
Look at the OBJ files produced by 3DS Max and compare them to the ones made by Wings 3D. It's really easy to spot why the 3DS Max ones work correctly. Here is an excerpt from the 3DS Max one:

g balloon_Balloon
usemtl _balloon_MkVII_4Balloon
s 1
f 1/1/1 2/2/2 3/3/3
f 1/1/1 4/4/4 5/5/5
f 3/3/3 6/6/6 7/7/7
f 3/3/3 4/4/4 1/1/1
f 3/3/3 8/8/8 4/4/4
f 3/3/3 9/9/9 8/8/8
f 7/7/7 6/6/6 10/10/10
f 7/7/7 9/9/9 3/3/3
f 10/10/10 9/9/9 7/7/7
f 10/10/10 11/11/11 9/9/9
f 5/5/5 2/2/2 1/1/1
f 5/5/5 12/12/12 2/2/2

Look how everything is a 1:1 ratio (vertices are not optimized). This one is ready for import into a GR2 file. Check the Wings3D one and you'll see that there is no 1:1 ratio (it's very evident). It's not Granny friendly. Do you see what I'm talking about?

Last edited by TheDarkWraith; 01-23-14 at 09:03 AM.
TheDarkWraith is offline   Reply With Quote
Old 01-23-14, 09:05 AM   #7
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
Look at the OBJ files produced by 3DS Max and compare them to the ones made by Wings 3D. It's really easy to spot why the 3DS Max ones work correctly. Here is an excerpt from the 3DS Max one:

g balloon_Balloon
usemtl _balloon_MkVII_4Balloon
s 1
f 1/1/1 2/2/2 3/3/3
f 1/1/1 4/4/4 5/5/5
f 3/3/3 6/6/6 7/7/7
f 3/3/3 4/4/4 1/1/1
f 3/3/3 8/8/8 4/4/4
f 3/3/3 9/9/9 8/8/8
f 7/7/7 6/6/6 10/10/10
f 7/7/7 9/9/9 3/3/3
f 10/10/10 9/9/9 7/7/7
f 10/10/10 11/11/11 9/9/9
f 5/5/5 2/2/2 1/1/1
f 5/5/5 12/12/12 2/2/2

Look how everything is a 1:1 ratio (vertices are not optimized). Check the Wings3D one and you'll see that there is no 1:1 ratio (it's very evident).
Yep, but when I open the 3ds Max obj file in Wings3d, the duplicated vertices are apparently not there. Moreover, if I re-export those meshes, their UV map is broken again by GR2 Editor.

Maybe Max uses a special format for those vertices which is recognized by Wings, and redundant vertices (for Wings) are merged automatically on importing them?

The same does not apply to S3d/GR2 Editor obj exports. When inported in Wings3d, I can clearly see that meshes have been cut along the perimeter of their UV zones.
__________________
_____________________
|May the Force be with you!|
...\/
gap 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:42 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.