Skip to content

3D model cleanup - vessels #100

Description

@SGD1953

I have reviewed how the various models and textures in Masters and Production relate and it seems reasonable to bring this repository into a state where one can edit the 3D models which is not currently the case as

  • there is no consistent source format
  • models are missing for most vessels with mesh in Assets-Production in bfxm format
  • texture/image names in production differ from here

I would suggest to generate the Wavefront obj and mtl files from production, update the image paths and commit them. That would allow the build pipeline to re-generate them consistently and we can use those files to regenerate the low-res HUD images in i.e. 1024x1024. An alternative would be to save Blender files, but as there is no native conversion via the vega-meshtool for .blend files this would require more work. We can have a default scene into which the .obj files can then be imported, this works relatively well.

There are some ships in Assets-Masters which are not in Production, I'd move them into a development subfolder to make it clear they are currently unused. If we decide to use them, they can be moved back. Here is a list, interestingly 1 ship is missing from source as well:

> Acrotatus
> AIDI
> Anaxander
< Charillus <- missing here
> Catfish
> Ct1000
> Ct3000
> Ellison
> Lemma
> Nietzsche
> Patterson

Tasks

  • Decide on ideal source format for the meshes
    • it would be great to understand the bfxm format better and which features it supports
    • its unclear if the conversion tools support the full feature set
    • Option 1 - save obj and mtl - see PR Vessel cleanup #101
      • Pros:
        • Standard format
        • Conversion works - can be genereated via vega-meshtool
        • compact, multiple ship parts can be in a single file
      • Cons:
        • Requires additional mapping to get it to work in Blender
      • Add obj and mtl files to this repository
      • Fix normals for the obj files with inverted normals
    • Option 2 - store xmesh format
      • Pros:
        • xmesh supports what the game engine supports, no information loss
        • example LODs: BFXM has references to LODs looking like <LOD size="12500.000000" meshfile="0_1.xmesh"/>
        • there are (outdated) existing plugins
      • Cons:
        • Requires plugins to get it to work in Blender
        • Harder to use in other tools as there is no plugin at the moment
        • quite verbose, all ship parts are individual files
      • migrate blender_xmesh_import.py to latest Blender version
      • migrate blender_xmesh_export.py to latest Blender version
    • Option 3 - store Blender files in source
      • Pros:
        • Standard format
        • Allows to properly set materials
      • Cons:
        • Requires additional work to make the model work in vs
          • could be solved via the exporter
          • i.e. vs currently has map_Normal which Blender does not know
      • Add obj and mtl files to this repository
      • Fix normals for the obj files with inverted normals
  • Re-render HUD images in higher resolution using those models

After investigating the different options the winner is Option 2 as this is the only format which we can truly convert into both directions - specifically the LODs which would otherwise get lost. Each LOD .xmesh can then be converted into obj/mtl or directly used in Binder via the import/export plugins.

There are still some minor question marks on the bi-directionality of the conversion, I tried two ships and compared original vs. original > XMESH -> BFXM conversion. Llama was an exact match, Plowshare resulted in 52 bytes more.

Important: while BFXM -> XMESH unpacks all parts, XMESH -> BFXM required to create the file and then subsequently add the remaining parts (not the LODs, they get automatically included)

bash: vega-meshtool --input plowshare.bfxm --output 0_0.xmesh --convert BFXM XMesh create
bash: ls
0_0.xmesh
0_1.xmesh
0_2.xmesh
0_3.xmesh
0_4.xmesh
1_0.xmesh
1_1.xmesh
1_2.xmesh
1_3.xmesh
1_4.xmesh
2_0.xmesh
2_1.xmesh
2_2.xmesh

0_0 properly references the LODs
<Mesh scale="1.000000" reverse="0" forcetexture="0" sharevert="0" polygonoffset="0.000000" blend="ONE ZERO" alphatest="0.000000"  texture="wayfarer.png"  texture1="wayfarerPPL.jpg" >
<Material power="60.000000" cullface="1" reflect="1" lighting="1" usenormals="1">
	<Ambient Red="0.650000" Green="0.650000" Blue="0.650000" Alpha="1.000000"/>
	<Diffuse Red="1.000000" Green="1.000000" Blue="1.000000" Alpha="1.000000"/>
	<Emissive Red="0.000000" Green="0.000000" Blue="0.000000" Alpha="1.000000"/>
	<Specular Red="1.000000" Green="1.000000" Blue="1.000000" Alpha="1.000000"/>
</Material>
<LOD size="5000.000000" meshfile="0_1.xmesh"/>
<LOD size="2500.000000" meshfile="0_2.xmesh"/>
<LOD size="7500.000000" meshfile="0_3.xmesh"/>
<LOD size="3500.000000" meshfile="0_4.xmesh"/>
...

bash: vega-meshtool --input 0_0.xmesh --output plowshare_test.bfxm --convert XMesh BFXM create
bash: ls
  974948 plowshare.bfxm
  821968 plowshare_test.bfxm
bash: vega-meshtool --input 1_0.xmesh --output plowshare_test.bfxm --convert XMesh BFXM add
bash: vega-meshtool --input 2_0.xmesh --output plowshare_test.bfxm --convert XMesh BFXM add
bash: ls
  974948 plowshare.bfxm
  975000 plowshare_test.bfxm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions