Fallout 4 and SSE support improvements

Various changes that involve getting FO4 and SSE support in a better shape.

  • Drop GeometryInterface abstraction for NiGeometry and BSGeometry. It's apparently not in any way useful.
  • Read Fallout 4 skinning data records and various extra data records. Read NiLightRadiusController. This reduces the number of known completely unsupported NIF records in the official Fallout 4 files to one (segmented BSTriShape), though there are probably other. NifTools understanding of that record is somewhat messy and I would like to give it some more thought. It's used in every Fallout 4 model that has body parts (3 thousand of them), granted they're not especially commonly seen in the base game right now.
  • Support BSTriShape geometry. Right now this is somewhat placeholder-ish, as ideally we'd want to have ready-to-go arrays in the NIF structs and not have to postprocess the vertex data, while the currently unsupported normalized byte and half float data is converted from the respective data types to float in the process, and we'd want to have the relevant data types supported by OSG, our shaders and custom geometry scene nodes (among other things). So there's a lot of room for improvement here. Half-to-float conversion is mostly incomprehensible gibberish, but it's something that works.
  • Support FO4 format of BSTriShape skinning. SSE format is much more awkward and involves dealing with NiSkinPartitions. FO4 data is converted into the format compatible with the current API. I'm not exactly sure which files are currently affected given the absence of "body part handling", but skinning is used for baby Shaun. Just like it's unclear how to use mTransform from NiSkinInstance, it's unclear how to use mScales from BSSkin::Instance, so that remains hanging.
  • Some restructuring of geometry handling. NiSkinInstance skinned geometry and morph geometry handling has been merged into handleNiGeometry. Once the path forward is clearer with SSE, NiSkinPartition and BSSkin, things will be put into their own functions again, but right now this makes it easier to compare between BSGeometry and NiGeometry handling. collectDrawableProperties no longer collects leaf-specific shader and alpha properties.
  • Support BSSegmentedTriShape geometry in both NifOsg NifLoader and BulletNifLoader. I guess the geometry is supposed to be split into distinct segments but this is probably not important right now.
  • Update resource path handling. This actually concerns any game including Morrowind and is based on previously learned information that got lost: consecutive slashes are dropped, all slashes are converted into backslashes (it's more for convenience), a valid path that starts with the top level directory is now attempted to be found in the input path before the top level directory is prepended (this is also something NifSkope does). This allows malformed plant texture paths in SSE to be handled properly.

Fallout 4 is... extremely rough and things take forever to load. SSE is somewhat better but isn't in a very good shape:

  • BulletNifLoader doesn't autogenerate "placeholder" collision for BSTriShape like it currently does for Gamebryo geometry. You could argue it's not actually worth the trouble, but it still means you can't walk across interior cells.
  • Red-green normal maps are currently unsupported so the lighting in Fallout 4 is mostly broken...
  • ...in addition to being extremely bright in general due to unhandled changes in the ESM and Beth's abuse of their deferred renderer
  • Fallout 4 materials aren't loaded as it requires much more involved changes to the resource system and a lot of things to be reconsidered in general, so everything is mostly untextured
  • SSE skinning isn't supported as mentioned above, so no trees.

But things are happening!
изображение
изображение
изображение
изображение изображение

A lot of the ideas for this were picked up from !3217 (closed) but were heavily tweaked/rewritten. This renders that MR obsolete.

This was not given a lot of love and care (this messy description included). If some new things seem too fuckulated, unfuckulating ideas are appreciated.

Merge request reports

Loading