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-25-14, 10:04 AM   #2176
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default



This is looking straight down at the top of the barrage balloon. Look at the vertex right in the middle of the screen. There are like 6-10 vertices at that one point! Why? The importer found that vertex to have multiple references with all different UV data. Why does that one vertex have multiple UV data? It's displaying one texture only. There's something wrong with the Wings3D export or you did something really screwy in the UV mapping.
TheDarkWraith is offline   Reply With Quote
Old 01-25-14, 10:10 AM   #2177
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
If you see multiple binormals and tangents for a vertex then it has been cloned by the importer (it needed to because different UV data for each clone was found).
Yep, I thought so. This has obvioulsy an effect on file size and memory usage. Using Meshalb and his object sorter, Privateer actually managed to compress model's size, but look how it looked:



http://www.subsim.com/radioroom/show...92#post2152092

Quote:
Originally Posted by TheDarkWraith View Post
This is an interesting thing of why it renders 'washed-out' in Goblin...What I'm having a hard time with is why the importer needed to clone some of the vertices multiple times when it appears they are only really needed once. Take the body for instance along the side. I can see multiple binormals and tangents which tells me that there are multiple vertices at that one vertex. I don't see why.
Yep, I see what you mean: I would have expected to see duplicate vertices along the borders of UV areas, but now every vertex seem to have multiple interations, no matter its position on the mesh/UV map

In any case I am afraid that this vertex iteration thing has nothing to do with the model looking washed out in Goblin. It is a material corruption.
I have re-imported the same object file in a copy of the same file I used for my previous tests, but disabled the update material checkbox. This is a Goblin rendering of the resulting file:



Quote:
Originally Posted by TheDarkWraith View Post
As far as the verifier saying it might be corrupt it's saying that because it found 'filler' between embedded strings. Most likely because you imported this into the GR2 file using a version < 400. It's nothing to worry about.


On a side note: I have a little (or big?) request. As it is now, you program won't let us to have multiple bone bindings per mesh. I wonder if this can be changes. It would be useful for when we need to iterate a mesh many times and, I suppose, it would reduce greatly memory usage.
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 01-25-14, 10:17 AM   #2178
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
In any case I am afraid that this vertex iteration thing has nothing to do with the model looking washed out in Goblin. It is a material corruption.
I have re-imported the same object file in a copy of the same file I used for my previous tests, but disabled the update material checkbox. This is a Goblin rendering of the resulting file:

On a side note: I have a little (or big?) request. As it is now, you program won't let us to have multiple bone bindings per mesh. I wonder if this can be changes. It would be useful for when we need to iterate a mesh many times and, I suppose, it would reduce greatly memory usage.
Look at the extended data between the file with the correct rendering and the one that doesn't. What is different?

You should be able to specify as many bone bindings as you want for a mesh. If that isn't working then I need to look into it. I coded that in a long time ago.
TheDarkWraith is offline   Reply With Quote
Old 01-25-14, 10:23 AM   #2179
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
There's something wrong with the Wings3D export or you did something really screwy in the UV mapping.
This is the UV map:



The top of the balloon (highlighted) is a continuous surface (I have just checked that there aren't unwelded vertices/edges). I can't see anything wrong in it. A 3ds max export of the same object provided by Targor, looks identical both in Wings and in GR2 Editor (same GR2 file size once imported, same binormals/tangents).
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 01-25-14, 10:29 AM   #2180
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Here's how my app rendered the texture coordinates:


What's interesting is that it had to tile it 2X2. I have to look over the code but I'm almost 100% sure it only tiles if it finds additional texture coordinates
TheDarkWraith is offline   Reply With Quote
Old 01-25-14, 10:43 AM   #2181
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

okay looking over the render texture coordinates code the app only tiles if the texture coordinates exceed 1.0 (u or v) and every multiple of 1.0 (plus or minus) causes an additional tiling.

Thus since it had to tile 2 X 2 either or both the u and v texture coordinates exceeded 1.0 (texture coordinates were in the range of -1.0 to 1.0 or 0.0-2.0 or -2.0-0.0). But clearly some of those texture coordinates are not being used so they are redundant and should be removed.

Wings3D doesn't show tiling - that's one thing I disliked about it. Instead of tiling it just ensures all UV coordinates fall in 0.0-1.0 range (when rendering them)
TheDarkWraith is offline   Reply With Quote
Old 01-25-14, 10:57 AM   #2182
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
Look at the extended data between the file with the correct rendering and the one that doesn't. What is different?
IIRC, Ambient Color, Diffuse Color, Specular Color and Shininess Strength are affected. But no matter what they are set to, once the material get "corrupt" (after being updated by your application), the model will look washed out in Goblin.

Quote:
Originally Posted by TheDarkWraith View Post
You should be able to specify as many bone bindings as you want for a mesh. If that isn't working then I need to look into it. I coded that in a long time ago.
Either this feature got broken somehow, or I use it the wrong way

Quote:
Originally Posted by TheDarkWraith View Post
okay looking over the render texture coordinates code the app only tiles if the texture coordinates exceed 1.0 (u or v) and every multiple of 1.0 (plus or minus) causes an additional tiling.

Thus since it had to tile 2 X 2 either or both the u and v texture coordinates exceeded 1.0 (texture coordinates were in the range of -1.0 to 1.0 or 0.0-2.0 or -2.0-0.0). But clearly some of those texture coordinates are not being used so they are redundant and should be removed.

Wings3D doesn't show tiling - that's one thing I disliked about it. Instead of tiling it just ensures all UV coordinates fall in 0.0-1.0 range (when rendering them)
The balloon body/side ropes UV map has not tilling. Ridging cables and picketing lines are tiled many times though. The tiling is shown correctly in Wings3d and in GR2 Editor, but not in game
__________________
_____________________
|May the Force be with you!|
...\/

Last edited by gap; 01-25-14 at 11:07 AM.
gap is offline   Reply With Quote
Old 01-25-14, 11:05 AM   #2183
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Figured out why it looks 'washed-out'. Change the shininess strength to 0 in the extendeddata. Problem solved

I'm looking over my code to see if I screwed up and that value should be in range 0-1.0 vice 0-100.
TheDarkWraith is offline   Reply With Quote
Old 01-25-14, 11:07 AM   #2184
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Yep I screwed up in the code. Shininess strength should be in range 0.0-1.0. I'll correct the code

For your barrage balloon set shininess strength to 0.5 and it will look like you wanted it to.
TheDarkWraith is offline   Reply With Quote
Old 01-25-14, 11:18 AM   #2185
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
Yep I screwed up in the code. Shininess strength should be in range 0.0-1.0. I'll correct the code

For your barrage balloon set shininess strength to 0.5 and it will look like you wanted it to.
It works
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 01-25-14, 12:56 PM   #2186
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
Thus since it had to tile 2 X 2 either or both the u and v texture coordinates exceeded 1.0 (texture coordinates were in the range of -1.0 to 1.0 or 0.0-2.0 or -2.0-0.0). But clearly some of those texture coordinates are not being used so they are redundant and should be removed.
I have scaled the UV map of my balloon body model using Wings3d's "Max uniform" command. this command moves each item to the center, and scales it so that its length/width (whatever is bigger) is equal to one texture unit. In other words, it ensures that no UV coordinate exceeds the 0-1 range.

Result: after re-importing the object with GR2 Editor, and clicking on the 'Show' button, the texture is tiled 3 x 3 times, rather than 2 x 2.

My suspect is that either your code has 0-1 set as texture range, but with 0 and 1 not included, or for some reson Wings3d slightly exceeds this range

Edit:

no, it can't be this: I have scaled all my UV items so that they are well within the size of one texture, but GR2 Editor keeps showing them in a 2 x 2 frame
__________________
_____________________
|May the Force be with you!|
...\/

Last edited by gap; 01-25-14 at 01:15 PM.
gap is offline   Reply With Quote
Old 01-25-14, 01:14 PM   #2187
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
I have scaled the UV map of my balloon body model using Wings3d's "Max uniform" command. this command moves each item to the center, and scales it so that its length/width (whatever is bigger) is equal to one texture unit. In other words, it ensures that no UV coordinate exceeds the 0-1 range.

Result: after re-importing the object with GR2 Editor, and clicking on the 'Show' button, the texture is tiled 3 x 3 times, rather than 2 x 2.

My suspect is that either your code has 0-1 set as texture range, but with 0 and 1 not included, or for some reson Wings3d slightly exceeds this range
I'm looking over all this code again. It's slowly coming back to me I looked over the OBJ file and all vt's were in the range 0.0-1.0 so I'm a little puzzled as to why the app tiled them.

As far as the shininess strength if you look at your MTL file the Ns is set at 50.0 so the app was doing everything correctly. It's just that granny expects this value in a 0.0-1.0 value. So what I've done is check this value to see if it's greater than 1.0 and if so then divide it by 100 to scale it to 0.0-1.0.

I've also got to update the lighting render so that it uses this value. I noticed that it didn't appear 'washed-out' with my app like it did in Goblin.
TheDarkWraith is offline   Reply With Quote
Old 01-25-14, 02:00 PM   #2188
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Ok I updated the renderer so that it's using the correct shininess value. Now if you get shininess strength value > 1.0 you will see this (if lighting is enabled):


Shininess strength was 50.0 in the above. With it set to 0.5 you get this:


Much better. Now you can verify it here along with Goblin

Looking into the mesh bone binding problem now
TheDarkWraith is offline   Reply With Quote
Old 01-25-14, 02:18 PM   #2189
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
Ok I updated the renderer so that it's using the correct shininess value. Now if you get shininess strength value > 1.0 you will see this (if lighting is enabled)
Brilliant

Quote:
Originally Posted by TheDarkWraith View Post
Looking into the mesh bone binding problem now
Using the same GR2 file that we have been experimenting on today, I have cloned the 'BalloonMkVII_wires' bone, gave it the 1 flag and changed its x position.

Problem #1: the "Update" button never worked for me (always greyed out). I can store the bone changes without updaing them though, and though being warned on saving that there are changes that need to be stored/updated, my changes are saved correctly.

Problem #2: I tried to link the cables to the new mesh. By pressing Ctrl, I can select a new bone by keeping the old one selected. After confirming the change, nothing happens in the Editor. When I open again the bone editing window, I can see that the mesh is still linked to the old bone, but not to the new one.

Problem #3: I can discard the old bone linking and select a new one (without pressing Ctrl). The change is accepted apparently. The next time I open the bone linking Editor, it shows that the new bone is selected, but the viewport tells me that the mesh is still linked to the old bone.
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 01-25-14, 02:32 PM   #2190
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
I have scaled the UV map of my balloon body model using Wings3d's "Max uniform" command. this command moves each item to the center, and scales it so that its length/width (whatever is bigger) is equal to one texture unit. In other words, it ensures that no UV coordinate exceeds the 0-1 range.

Result: after re-importing the object with GR2 Editor, and clicking on the 'Show' button, the texture is tiled 3 x 3 times, rather than 2 x 2.

My suspect is that either your code has 0-1 set as texture range, but with 0 and 1 not included, or for some reson Wings3d slightly exceeds this range

Edit:

no, it can't be this: I have scaled all my UV items so that they are well within the size of one texture, but GR2 Editor keeps showing them in a 2 x 2 frame
I 'broke' into the code at the point where it goes to render the texture coordinates and dumped the contents of the mesh's UV coordinates. I don't understand why DirectX did this but here's an excerpt of those uvs:
Code:
u=0.959849 v=-0.300698
u=0.976901 v=-0.300698
u=0.976901 v=-0.002600
u=0.959849 v=-0.002600
u=0.959849 v=-0.598797
u=0.976901 v=-0.598797
u=0.976901 v=-0.300698
u=0.959849 v=-0.300698
u=0.964299 v=-0.300698
u=0.967409 v=-0.300698
u=0.970569 v=-0.300698
u=0.973906 v=-0.300698
u=0.973906 v=-0.002600
u=0.970569 v=-0.002600
u=0.967409 v=-0.002600
u=0.964299 v=-0.002600
u=0.964299 v=-0.598797
u=0.967409 v=-0.598797
u=0.970569 v=-0.598797
u=0.973906 v=-0.598797
u=0.973906 v=-0.300698
u=0.970569 v=-0.300698
u=0.967409 v=-0.300698
u=0.964299 v=-0.300698
u=0.976302 v=-0.002600
u=0.975703 v=-0.002600
u=0.975104 v=-0.002600
u=0.974505 v=-0.002600
u=0.976302 v=-0.300698
Since there are values in 0.0-1.0 range and values in -1.0-0.0 range the app tiled them 2X2. So the app is doing exactly what it was programmed to do.

DirectX must have 'optimized' these UVs when I called the DirectX function to optimize the mesh . My local copy of the vertices that were used to build the mesh have the 'correct' uvs with all in the range 0.0-1.0. Strange. DirectX is doing what it needs to do I guess
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 09:56 AM.


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.