SUBSIM Radio Room Forums

SUBSIM Radio Room Forums (https://www.subsim.com/radioroom/index.php)
-   SH5 Mods Workshop (https://www.subsim.com/radioroom/forumdisplay.php?f=249)
-   -   [WIP] Almagest. Strict Import for SH5. (https://www.subsim.com/radioroom/showthread.php?t=248714)

kapuhy 03-08-21 08:01 AM

Quote:

Originally Posted by Jeff-Groves (Post 2734682)
I have the basic stuff done.
I need something that uses a Diffuse obj and an AO obj file now.
:03:

Here's another test subject - this is one of relased ships from my coaster mod, has diffuse, ao as well as damage and lod models. I imported it using loose import setting into NF_boat_1 (Coastal Boat) gr2 file (both obj before import and imported files attached).

Test subject - motor coaster

Jeff-Groves 03-09-21 01:03 PM

@kapuhy

Those files are exactly what I wanted to look at.
They show the problem I'm working to fix to allow them to be adjusted and imported as Strict.
:salute:

If you look at the 2 files for the rudder you can see the problem when you look close at the faces section of the obj files.
Same number of faces but they do not match! That is the shuffling part that I spoke about.

Jeff-Groves 03-12-21 11:04 AM

One of the things I'm working on is to test different sized obj imports under the Loose option.

I'm trying to see if that option can be used to create custom sized perimeters
that We could then use for a strict import to keep file size as low as possible.

The adjustments to the files one creates are figured out and tested.
Just need to work on the code for that.

It's actually really simple based on how the GR2 file is constructed and how the obj format works.

Jeff-Groves 03-13-21 12:17 PM

Yes. We can shrink the meshes in a GR2 file with a loose import.
Not a perfect way to do so since the Loose import is based on false assumptions and a total misunderstanding of how the GR2 meshes work with the obj format.
But a good work flow option to take advantage of.

gap 03-13-21 02:32 PM

Quote:

Originally Posted by Jeff-Groves (Post 2735947)
Yes. We can shrink the meshes in a GR2 file with a loose import.
Not a perfect way to do so since the Loose import is based on false assumptions and a total misunderstanding of how the GR2 meshes work with the obj format.
But a good work flow option to take advantage of.

Thank you Jeff :yeah:

Currently working on my model's diffuse mapping (AO mapping already done). I am eager to see the result of my efforts in game, and I hope your program will help me to optimize the import.

Jeff-Groves 03-18-21 02:02 PM

Let's look at the 3D objects stored in a gr2 file.
Verts, normals, textures, etc ALWAYS have the same count.
Faces are totally separate from that.

So here's the magic and simplicity.
We can match the verts and such by just copying existing verts or whatever and pasting so each has the same count.

500 texture points? Make sure verts is 500 etc.

The Faces will ONLY USE what they call!
Thus no loading of the extra duplicate information!
So I can have 500 verts and textures, etc BUT the faces say only render 100!

Don't believe me?
Export a mesh from a GR2, open it in any 3D program then save it.
If your program optimizes an obj file? Compare them in notepad or any other text reader.

Jeff-Groves 03-18-21 02:30 PM

How will this program work?

It will look at both a base obj file and if selected the AO version.
Then it will adjust the files to have the same counts.

Once saved? You find a candidate GR2 file.
Say you need 500 verts and 95 faces to do a Strict import.
Your files have 400 verts and 35 faces.
We run the program and tell it the verts and faces needed.
It will adjust them for a strict import from there.

This is just Ghosting both TDW's program AND the GR2 files based on knowledge of how both work!

A similar approach will Ghost S3D also!

I prefer to call it Ghosting instead of Faking it till you make it.

kapuhy 03-20-21 05:49 AM

Quote:

Originally Posted by Jeff-Groves (Post 2737245)
Once saved? You find a candidate GR2 file.
Say you need 500 verts and 95 faces to do a Strict import.
Your files have 400 verts and 35 faces.
We run the program and tell it the verts and faces needed.
It will adjust them for a strict import from there.

Forgive layman question :) If my files have 600 verts and 115 faces, I'll need to find a template gr2 with higher count than mine, right? So instead of having to find template with identical count like is now the case (which is pretty much impossible unless we're just making minor edits to stock model), we'll use templates with <equal or lower> count?

Jeff-Groves 03-20-21 05:54 PM

You will need to find a GR2 with as close a count as possible but ALWAYS higher then your adjusted files.

You will still get a smaller ending GR2 then loose import will ever give you!

Remember this point!
Say you find a nice GR2 but it just has to many parts.
We can use the loose import to shrink them to nothing thus reducing the size even more!

gap 03-20-21 07:24 PM

Quote:

Originally Posted by Jeff-Groves (Post 2737239)
Let's look at the 3D objects stored in a gr2 file.
Verts, normals, textures, etc ALWAYS have the same count.
Faces are totally separate from that.

So here's the magic and simplicity.
We can match the verts and such by just copying existing verts or whatever and pasting so each has the same count.

500 texture points? Make sure verts is 500 etc.

The Faces will ONLY USE what they call!
Thus no loading of the extra duplicate information!
So I can have 500 verts and textures, etc BUT the faces say only render 100!

Don't believe me?
Export a mesh from a GR2, open it in any 3D program then save it.
If your program optimizes an obj file? Compare them in notepad or any other text reader.

One of the biggest problems I had in the past, was matching vertex order in the main and uv2 meshes. There is a bunch of reasons why various obj exporters might change that order, but the final result is the same: after importing in GR2 Editor, the AO mapping is messed up even though the two imported objects are apparently identical in their vertex/face structure.

In theory, if all the vertices in an object had different coordinates, we could easily create a tool which will automatically sort uv-2's vertices according to main object's template. The problem is that, after edge-splitting hard edges (for correct smoothing in game), most import candidates will have a lot of duplicated vertices with identical xyz and uv coordinates, but placed on different meshes. Making our tool to automatically discern them wouldn't be that easy.

Quote:

Originally Posted by Jeff-Groves (Post 2737697)
You will need to find a GR2 with as close a count as possible but ALWAYS higher then your adjusted files.

You will still get a smaller ending GR2 then loose import will ever give you!

Remember this point!
Say you find a nice GR2 but it just has to many parts.
We can use the loose import to shrink them to nothing thus reducing the size even more!

If I got you correctly, the above criterion should be applied not only to the main object, but also to all the subparts. Finding a GR2 file which will match the requirements for all the model parts, or shrinking all the parts in our models so that they won't exceed the vert count of the GR2 template they will be imported in, might be a little PITA, but I definitely see the advantages of your program and of the working method you are suggesting :salute:

Jeff-Groves 03-20-21 07:47 PM

Don't worry about Vert count nor texture count. That is easily sorted!
On face count? Those should be the same as far as count but can be adjusted.
They may be different but the GR2 file accounts for that!

AMZ 04-16-21 11:40 AM

Hello Jeff-Groves,

Following your feedback

Quote:

Originally Posted by Jeff-Groves (Post 2685757)
With just a little text editing of the obj files you can do a strict import
and get a much smaller file size.


Personally?
I use a script I wrote for 010 that looks at the new obj files and adjusts them for a strict import.

Hello Jeff-Groves,

Sorry to answer you so late, I admit I did not understand the meaning of your advice.
Today I am less stupid, thanks to your writings elsewhere.

In this regard, you say that you have made an application: "Almagest".
Is she available? Where can we find it?

Thank you




On the other hand, maybe you have an idea of what concerns me?

Click Here ;
 
Quote:

Originally Posted by AMZ (Post 2742248)
Hi to all


After the first advice, and thank you for that, I thought I'd manage on my own, but I have some problems with the realization

I am coming back to you in the hope of having a solution.
My problem: Creating an earthly object as a characteristic Seamark
Example: a church, a bell tower, a lighthouse, etc.


Here are my questions:

1 - TDW editor for GR2 Files seems a great tool, but for lacking of information I am not an expert in its use.

Can we create from nothing, from zero

*. the skeleton bones and a hierarchy of these bones?
*. Initial parent with his own name then parentage for the Meshs (Diffus - AO) then Meshs Collision?

2 - I got around the No. 1 problem for my first realization by copying an existing object

Either in C:... / ... 'Silent Hunter 5 with TWOS'data-Terrain-Locations'CustomAreas-germany
The Church object: church. GR2 and associated .sim

Note: This one as is in the game, is not visible if placed with the mission editor ...
The 3D model is very far from the reference point, about 1 km after Gmax or Blender.

So with Blender I remade the church at the reference point, so that an placement in the mission editor corresponds to the place pointed and seen in the game, map or TAI .
Of course, I transcribed the exported files in .obj format using the Note Block.
I checked the correct transcription by importing and exporting again in the Wings3D editor.

Using TDW-editor, I imported the renamed files
Church_AMZ.obj
Church_AMZ_AO.obj
And Collision_ Church_AMZ.obj
They appear well at Zero Point ... It's ok.

But since this is a clone of the GR2 file with 3D replacement,
I decided to replace the names of the skeleton and bones, then the parents Meshs, in order to have the identifiers remapped. Not expert with the TDW, I did it using a Hexa editor.

Here's my second question:

*. Can we in TDW change the names of skeleton, bones etc?
*. In the same way for the Meshs, can we edit the names of the Parents masters?
Sometimes this is possible for certain filiations. ???

Not being a programmer, I just replaced Letters by Letters the name without changing the length of the GR2 file (Hexa).
Of course, I remapped the Church_AMZ.sim file accordingly.
The Church_AMZ.GR2 file thus modified opens correctly in the TDW, after having automatically corrected the byte counter ...
Control by opening everything in GobinEditor (_.GR2 and _.sim merge)
...
Everything seems correct!
I did a mission (MissionEditor) in order to have the visual in the game ... There's nothing???



Please, can you give me a Thread where I could refer ?
Can you help me in my process ?

With all my gratitude.


Jeff-Groves 11-24-21 03:29 PM

A few months down the road and several Alpha versions to sort problems and all is GOOD!
Mostly real life obligations have kept me away from the final Coding parts.
Final parts are to actually write the Faces and texture sorting.
That I wrote in my head while driving all over the USA.
Then debugged much of it in my head!
:o

kapuhy 11-25-21 12:17 PM

Quote:

Originally Posted by Jeff-Groves (Post 2780113)
A few months down the road and several Alpha versions to sort problems and all is GOOD!
Mostly real life obligations have kept me away from the final Coding parts.
Final parts are to actually write the Faces and texture sorting.
That I wrote in my head while driving all over the USA.
Then debugged much of it in my head!
:o

Good to hear it! I have a queue of ship models on the slipways waiting for import to SH5 and I'm looking forward to use Almagest on them. Keep up the good work as BdU uses to say :up:

Jeff-Groves 11-25-21 01:04 PM

I did figure out a lot that allows me to 'kind of' brand any files.
:haha:

It does NOT have any effect on SH5 files using Almagest.
And you'd need the Key files I also created to decode the hidden information!

Call it an Easter Egg! I'm well known for those!
:03:

gap 11-30-21 03:47 PM

@ Jeff

Are you still interested into testing your importer on my Clyde puffer model?
I am still working on textures (AO and diffuse map are WIP and specular and normal maps are missing), but 3D models and UV maps (both diffuse and AO) should be OK for import. Drop me a PM or an e-mail if you want to check them :salute:


Jeff-Groves 11-30-21 03:56 PM

Quote:

Originally Posted by gap (Post 2780950)
@ Jeff

Are you still interested into testing your importer on my Clyde puffer model?
I am still working on textures (AO and diffuse map are WIP and specular and normal maps are missing), but 3D models and UV maps (both diffuse and AO) should be OK for import. Drop me a PM or an e-mail if you want to check them :salute:

Send me a link by PM! Would love to test them!

gap 11-30-21 04:00 PM

Quote:

Originally Posted by Jeff-Groves (Post 2780952)
Send me a link by PM! Would love to test them!

Excellent, thank you Jeff! I have all the parts in one Wings file. Can I send them in their original format or do you prefer me to convert them as obj files?

Jeff-Groves 11-30-21 04:03 PM

obj files please.
I've only coded to read and adjust obj files at this time.
Now I may change that to read Wings files also at some point.

gap 11-30-21 04:14 PM

Quote:

Originally Posted by Jeff-Groves (Post 2780956)
obj files please.

OK, in that case exporting all the parts one by one will take some time. Please wait until tomorrow :)

Quote:

Originally Posted by Jeff-Groves (Post 2780956)
I've only coded to read and adjust obj files at this time.
Now I may change that to read Wings files also at some point.

That indeed would be a nice for a lazy boy like me, but not a priority :up:


All times are GMT -5. The time now is 08:19 PM.

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.