Page 2 of 7

Re: JX3 HD Remake 剑网3 (.dat files)

Posted: Wed Oct 03, 2018 12:19 pm
by Bigchillghost
shakotay2 wrote:FVFsize= 6; but I see, it's ShortAll (instead of WordUV, which you seem to have used for uvs' displaying only.)
Oh, I forgot that WordUV is actually using float as vertex type. :D
My confusion also aroused from the fact that there seems to be 6 floats values (bound box) before the mesh using shorts.
Yeah, I guess it's related to the scaling of the model. There're also 3 floats before the UV buffer. Maybe a scaling for UVW?

Re: JX3 HD Remake 剑网3 (.dat files)

Posted: Wed Oct 03, 2018 4:16 pm
by shakotay2
petventh18 wrote:...with this maybe someone can help write a Noesis/Max script to import/export them.
well, I'm not a fan of writing scripts but as a first helper this tool may serve:
Make_obj-JX3.zip
Uses simple formula for getting the uvs' start address, so might fail.
Tested with 00000506.mesh and 00000163.mesh only!

Might make sense to manually insert some g SM_x lines into the MakeObj_log.obj in case there's submeshes.

You might try this H2O file for 00000163.mesh with hex2obj (0.24e required to have the 'unsigned shorts' box checked!)

0x70061 56925
Vb1
6 99
0x12C 18341
040300
0x3A499 6

(It produces an obj file (File/SaveAs mesh) with g SM_x lines inserted each 500 faces.)
------------------------------

The H2O file for 00000161.mesh is

0x5588D 34152
Vb1
6 99
0x12C 14001
040300
0x2C835 6

With the tool you'll need to correct the uvs startaddress here.
In the lower left editbox it reads 2C833 after loading the above mentioned mesh file. When checking this in a hexeditor you'll see (with a little experience) that the auto calculation is 2 bytes "off".

So exit (important!) and restart the tool, don't load the mesh!

In the editbox type 2C835, no typos, please!
then load the 00000161.mesh again.

The procedure may be required for other *.mesh, too, review the proposed uv start address in a hexeditor to decide whether it must be corrected.

Re: JX3 HD Remake 剑网3 (.dat files)

Posted: Wed Oct 03, 2018 4:32 pm
by shakotay2
"submeshes" 500 faces each:
00000506-mesh.png

Re: JX3 HD Remake 剑网3 (.dat files)

Posted: Wed Oct 03, 2018 8:46 pm
by shakotay2
00000158.mesh, x and y scaled by 2.0:
00000158-ship.png

Re: JX3 HD Remake 剑网3 (.dat files)

Posted: Wed Oct 03, 2018 9:00 pm
by petventh18
Bigchillghost wrote:Well it's just an issue resulting from the illegal extensions. I've improved the code for determining them, especially more accurately for the mesh files so you might need to run the lastest version on all packages again. Sorry about that.
Oh thank you for the update.
shakotay2 wrote:well, I'm not a fan of writing scripts but as a first helper this tool may serve:...
Thank you... it help... I'll try to shamelessly to modified some Noesis script to see if I can make it work for this game... that way it'll be easier to export them in batch.

Re: JX3 HD Remake 剑网3 (.dat files)

Posted: Thu Oct 04, 2018 4:42 am
by Bigchillghost
shakotay2 wrote:00000158.mesh, x and y scaled by 2.0:
Had you used the bounding box?
000003B3.jpg
Seems OK with the character:
Image

Now the problem is to get correct normal vectors:
Image

Re: JX3 HD Remake 剑网3 (.dat files)

Posted: Thu Oct 04, 2018 5:16 am
by petventh18
Bigchillghost wrote: Image
It seems that the model needs proper scaling to get the perfect mesh.
I put everything that appear on your screenshot but I don't have the same thing...
Can you give me some pointer?
Image
I don't have a checkbox right after the dropbox "ShortAll" so I think that's the reason.

Re: JX3 HD Remake 剑网3 (.dat files)

Posted: Thu Oct 04, 2018 5:24 am
by Bigchillghost
You need version 0.24e to handle unsigned shorts.
viewtopic.php?p=142434#p142434

Re: JX3 HD Remake 剑网3 (.dat files)

Posted: Thu Oct 04, 2018 5:28 am
by petventh18
Bigchillghost wrote:You need version 0.24e to handle unsigned shorts.
viewtopic.php?p=142434#p142434
Oh lol stupid me... I reread shakotay2 post and he did mentioned it... I was being dumb...

But yeah after I used version 0.24e this is what I got...
Image

It look like some backcurling happening there... but it look different than yours.

Re: JX3 HD Remake 剑网3 (.dat files)

Posted: Thu Oct 04, 2018 5:34 am
by Bigchillghost
I just import it into Max and inverted the normals.

Re: JX3 HD Remake 剑网3 (.dat files)

Posted: Thu Oct 04, 2018 5:37 am
by petventh18
Bigchillghost wrote:I just import it into Max and inverted the normals.
Oh yeah you're right nvm, your model SS was from 3d software... so I was being dumb again.
But can you tell me how you got the start address and count and then the FVF Size? I watch some youtube video on how to use Hex2Obj but i kept getting different numbers than yours.

Re: JX3 HD Remake 剑网3 (.dat files)

Posted: Thu Oct 04, 2018 5:43 am
by Bigchillghost
Here's the structure of the header from offset 0x90:

Code: Select all

long	Vcount
long	TrixCount
long	MtlGroupCount
long	Voffset // 6 floats for bounding box before vertex data
long	NormalOffset
long	NULL
long	UVoffset // 3 floats before UV data
long	NULL
long	NULL
long	FIoffset
long	MtlGroupOffset
So the face indices count would be (TrixCount * 3).

Re: JX3 HD Remake 剑网3 (.dat files)

Posted: Thu Oct 04, 2018 5:56 am
by petventh18
shakotay2 wrote: Might be senseful to manually insert some g SM_x lines into the MakeObj_log.obj in case there's submeshes.
Is that how you split the mesh into multiple parts? Such as cloth, hair, head, face, etc?
Because I noticed the Make_obj-JX3.exe tool combined all of them into one mesh while Hex2Obj had them separated into submeshes.
Is it possible to do so as well?

Re: JX3 HD Remake 剑网3 (.dat files)

Posted: Thu Oct 04, 2018 5:59 am
by petventh18
Bigchillghost wrote:Here's the structure of the header from offset 0x90:

Code: Select all

long	Vcount
long	TrixCount
long	MtlGroupCount
long	Voffset // 6 floats for bounding box before vertex data
long	NormalOffset
long	NULL
long	UVoffset // 3 floats before UV data
long	NULL
long	NULL
long	FIoffset
long	MtlGroupOffset
So the face indices count would be (TrixCount * 3).
Thank you for the structure... that helps!

Re: JX3 HD Remake 剑网3 (.dat files)

Posted: Thu Oct 04, 2018 9:15 am
by shakotay2
Bigchillghost wrote:Had you used the bounding box?
nope, just a wild guess, because the BBox calculated from the unsigned vertex data in hex2obj doesn't match with the real values so far. Need to look what's going wrong there:
# BBox 0.000000 255.468750, 0.000000 255.468750, 0.000000 255.468750
00000503-mesh-BBox.png
petventh18 wrote:
shakotay2 wrote: Might be senseful to manually insert some g SM_x lines into the MakeObj_log.obj in case there's submeshes.
Is that how you split the mesh into multiple parts? Such as cloth, hair, head, face, etc?
Didn't check a character so far, but 'yes', hex2obj inserts such lines all 500 faces each.
Because I noticed the Make_obj-JX3.exe tool combined all of them into one mesh while Hex2Obj had them separated into submeshes.
Is it possible to do so as well?
Is possible, but generally that splitting results in random submeshes (SMs). It's just kind a luck that the static models seem to have roundabout 500 faces clusters here, imho.

So for characters it's more sensefull to insert those lines manually, as there's aren't so many SMs, head, upper body, lower body for example.