Schlechtwetterfront / xsizetools

Softimage exporter and importer for ZeroEngine (Star Wars Battlefront I + II) .msh 3D files.
http://schlechtwetterfront.github.io/xsizetools/
Other
19 stars 4 forks source link

SWBF meshes's shadowvolumes break on import #14

Open FoxTheBlueman opened 2 months ago

FoxTheBlueman commented 2 months ago

So it has been known for a little while by the community but I don't think it was ever reported properly.

Whenever you try to import a model from Swbf using the latest build of ZETools the shadow volume breaks and is imported as a null (or not imported at all in some instances). It happen with most Swbf 2 models shipped in the assets, same for models from Swbf 1.

Here's a google-drive link to a couple of example props from BFBuilder: https://drive.google.com/file/d/1nv43bkPRjuXr8FpwH8qR3Y7m1pnwv5Zm/view?usp=sharing

On the interesting side of things, bes1_bldg_main01.msh - shadowvolume1 (for the interior) properly imports as a mesh, though the other shadowvolume (for the building itself, shadowvolume_shadow_) is still broken. This case is rather rare, it's one of the only swbf mesh to have at least one working shadowvolume.

The static shadow volumes used are special segments in the mesh similarly to collision primitives. ZETools doesn't handle them (ZETools has no issue importing shadow volumes from character models, whether it'd be from Swbf or Swbf 2).

Basically no Swbf 1/Swbf 2 model has ever imported properly with shadow volumes intact unless it's the "sv_ type" which doesn't get a special segment type in the .msh.

Hope this help

Schlechtwetterfront commented 2 months ago

Shadow volumes (static ones with SHDW chunks) importing as nulls is "intended" behavior. Shadow geometry is special and import (or export) of it was just never implemented. The Pandemic exporter applies all sorts of operations on the source mesh to get the final shadow volume - my math is not up to par for that. If anyone does understand what's going on, I can try and convert it into code.

shadowvolume1 imports because it's not actually a shadow volume (has no SHDW chunk).