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 02-04-19, 05:45 PM   #1
Jeff-Groves
GLOBAL MODDING TERRORIST
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,655
Downloads: 137
Uploads: 0


Default

VT can be lower.
I have an obj file open now with 28566 vertices but has 1520 texture coordinates.
To make it GR2 compatible we would need to add texture coords.
Those can be a repeat or just 0. That should allow TDW's program to import as a 'clean'. I think that's his term.
Jeff-Groves is offline   Reply With Quote
Old 02-04-19, 05:51 PM   #2
Jeff-Groves
GLOBAL MODDING TERRORIST
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,655
Downloads: 137
Uploads: 0


Default

You can combine meshes into one obj file. They are still separate meshes If done right.

Then Bake. You only need the UV's (VT) for each mesh. Faces should not change.
Don't know if Wings3D or other programs can export UV's only or if you can have more then one texture channel in them.

Now. UV's are a quick way to change texture coords (VT) in Max. I burn AO in a different program, save the UV's, then import to Max.

To do the same if your program does not export just the texture information? Export the burned obj and copy paste the VT's when needed.
And before anyone asks? I can decode 3D Max UV's to vt's.

Read up on how the obj file handles faces. It's really simple once you fully understand it.
3 verts make a face. The f tells you what v gets what vt
f v1/t1 v2/t2 ....

Last edited by Jeff-Groves; 02-04-19 at 06:30 PM.
Jeff-Groves is offline   Reply With Quote
Old 02-04-19, 06:27 PM   #3
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by Jeff-Groves View Post
VT can be lower.
I have an obj file open now with 28566 vertices but has 1520 texture coordinates.
To make it GR2 compatible we would need to add texture coords.
Those can be a repeat or just 0. That should allow TDW's program to import as a 'clean'. I think that's his term.
I wonder how this is technically possible in a manifold space.

Let's take a simple primitive like a cube. In the XYZ space it has indubitably eight vertices. Unwrapped as in the figure below, it will have fourteen UV vertices, you can count then:



By stitching all the UV edges together, we can reduce vt number to eight (i.e. the number of XYZ vertices), but I don't see how we could make it smaller than the main vertex count.



Quote:
Originally Posted by Jeff-Groves View Post
You can combine meshes into one obj file. They are still separate meshes If done right.

Then Bake. You only need the UV's (VT) for each mesh. Faces should not change.
Sure, but when we separate an object into the single contiguous meshes composing it, and/or when we combine several objects into a bigger objects, vertices get re-numbered/re-sorted as a consequence of the separation and/or combination. Are we sure that when we recombine/re-separare them, to re-build the original objects, their vertices will be again in the exact same order?

Quote:
Originally Posted by Jeff-Groves View Post
Don't know if Wings3D or other programs can export UV's only or if you can have more then one texture channel in them.
I know that Max supports multiple UV coordinates, I that's what you mean. Unfortunately that's an useful feature missing from Wings3d (dunno about Blender).
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 02-04-19, 06:37 PM   #4
Jeff-Groves
GLOBAL MODDING TERRORIST
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,655
Downloads: 137
Uploads: 0


Default

You can fold that box to 4 to get a lower vt count.
faces will remain the same and just use the same vt in places.
Jeff-Groves is offline   Reply With Quote
Old 02-04-19, 06:43 PM   #5
Jeff-Groves
GLOBAL MODDING TERRORIST
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,655
Downloads: 137
Uploads: 0


Default

On putting multiple meshes in an obj? Don't weld the verts and they will remain a separate mesh! Burn your AO, then export ONLY that one mesh.
All things should be fine! Now in Max I have a script the will export all the meshes to separate obj files so it's simple. Maybe Wings has scripting abilities?
Jeff-Groves is offline   Reply With Quote
Old 02-04-19, 06:52 PM   #6
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by Jeff-Groves View Post
Read up on how the obj file handles faces. It's really simple once you fully understand it.
3 verts make a face. The f tells you what v gets what vt
f v1/t1 v2/t2 ....
You are right, if v's order was messed up during the recombining of an object (needed for baking its AO map), I could always grab the v coordinates of the main obj file (the one with diffuse UV map stored) and paste them in the AO obj file. The problem comes with face definitions. Keeping on your example, let's say that these are the face definitions of the main obj file:

f v1/t1 v2/t2 v3/t3

and these are the face definitions of the AO obj file (with messed up vertex order)

f v1(ao)/t1(ao) v2(ao)/t2(ao) v3(ao)/t3(ao)

The faces of the fixed AO obj file should look like this:

f v1/t1(ao) v2/t2(ao) v3/t3(ao)

I could do that file merger in excel indeed, but unless I find a way to create an 'intelligent' generic spreadsheet that works with obj files of any length, setting up a 'specific' spreadsheet every time, is going to be a time-expensive exercise...
__________________
_____________________
|May the Force be with you!|
...\/

Last edited by gap; 02-05-19 at 06:13 AM.
gap is offline   Reply With Quote
Old 02-04-19, 07:13 PM   #7
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by Jeff-Groves View Post
You can fold that box to 4 to get a lower vt count.
faces will remain the same and just use the same vt in places.
I am sorry but I don't get it. Of course I could overlap all the UV vertices so that they look just one vertex, but to my understanding the different number of vertices in the UV map than in the 3D geometry is only determined by the un-welding of some faces (more unwelding = more edges and more vertices). The only way to reduce again this number is by welding again the un-welded faces, but we can't weld UV faces that are not welded in the 3D geometry. Can we?

Quote:
Originally Posted by Jeff-Groves View Post
On putting multiple meshes in an obj? Don't weld the verts and they will remain a separate mesh! Burn your AO, then export ONLY that one mesh.
Yes, indeed but that's not what I was talking about.

Let's say that I have one object composed by two meshes let's call them a and b. the vertex sequence in that object is

v a1
v a2
v a3
v a...
v b1
v b2
v b3
v b...

Now let's say that we want to bake our object together with another object. After the creation of a new UV map (for the AO channel) and the AO baking we separate the combined object into the single meshes composing it, and then we re-compose the original objects. As long as we didn't alter the geometry of any single mesh, vertex order within them should not have changed. But what if the order of the meshes within the re-combined object has changed as a consequence of its separation and re-combination? We would find ourselves with an object so composed

v b1
v b2
v b3
v b...
v a1
v a2
v a3
v a...

Apparently the original object and the re-combined object will only differ in their UV mapping, but to GR2 Editor would be two different objects...

I hope I made myself clearer this time...

Quote:
Originally Posted by Jeff-Groves View Post
All things should be fine! Now in Max I have a script the will export all the meshes to separate obj files so it's simple. Maybe Wings has scripting abilities?
I don't think so
__________________
_____________________
|May the Force be with you!|
...\/

Last edited by gap; 02-04-19 at 07:24 PM.
gap is offline   Reply With Quote
Old 02-05-19, 11:06 AM   #8
Jeff-Groves
GLOBAL MODDING TERRORIST
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,655
Downloads: 137
Uploads: 0


Default

I think I know what you mean but I'm not positive.
Can you send me example obj files and which version of the GR2 editor you have a problem with?
Jeff-Groves is offline   Reply With Quote
Old 02-05-19, 02:16 PM   #9
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by Jeff-Groves View Post
I think I know what you mean but I'm not positive.
Can you send me example obj files and which version of the GR2 editor you have a problem with?
For the moment I have not good examples that I can send to you. No doubt I will, in case I face problems the next times that I will need to import some objects with their secondary UV map into a GR2 file.

I am not saying that the problem I tried to describe below will necessarily happen, or that all the problems we faced in the past were coming from there, but we should at least agree on the fact that this is something that can happen, and if it happens it can scramble the UV-map import.
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 02-19-19, 11:29 AM   #10
Jeff-Groves
GLOBAL MODDING TERRORIST
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,655
Downloads: 137
Uploads: 0


Default

Quote:
Originally Posted by gap View Post
we agree on the fact that this is something that can happen, and if it happens it can scramble the UV-map import.
I believe We saw this problem with the new wooden boats or the barrage balloon way back didn't we?
That issue may have been fixed with later releases of TDW's Exporter/Importer?
Jeff-Groves 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 06:15 AM.


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