FX Composer Projects and Packages
Details on the difference between the two storage formats (.fxcomposer
and .fxproj).
FX Composer 1.5 introduced .fxproj files, while keeping support for
.fxcomposer packages.
Both file formats describe a complete scene, with shader, texture
& geometry info. The differences between the two formats are below; the
essential difference being how the various components are stored:
-
Packages keep textures as part of the package, Projects
reference textures.
-
Packages embed geometry as base64 encoded,
Projects reference a binary geometry chunk for optimal storage.
-
Packages store .fx files as part of the package, Projects store .fx
file references to external files.
Packages (.fxcomposer)
FX Composer package files are actually .zip archives. They
currently contain:
The package file tries to be the best of both worlds: an easy XML
parseable file format, with a binary chunk for data that doesn't store
well as text (the XML refers to this data via an offset). You can
explore .fxcomposer packages simply by renaming to .zip.
Package files are ideal for shipping a complete scene with
effects and textures in a single binary. They are also compressed and
store geometry optimally, so save space.
Package files aren't so good if you have a lot of packages all
using the same texture maps - this results in duplicated media being
stored in each package.
Projects (.fxproj)
Projects are standalone XML files describing an entire
FX Composer scene, and its geometry. Geometry data is stored as
base64 encoded binary at various nodes in the XML.
Project files are a great way to store your scene if you want to
hand modify the file or read it from an external tool. They also save
file size, since they store references to texture files, not the actual
media.
Projects have the disadvantage that you need to ship the textures
& effects with the project. Projects also have a backup version of
their effects embedded in the XML. This is necessary to ensure the
project always loads its data correctly, even if the effect is not
found. FXComposer prompts the user to locate the .fx file, or use
the cached copy as of version 1.6.
XML Data
Both projects and packages have similar XML tree elements. The
main difference is that geometry data is stored in a separate binary
chunk for packages, but it is embedded in the XML for projects (because
they are intended to be standalone). As far as the XML content is
concerned:
-
The first line or so contains the file version and the build
version of FX Composer made to save it.
-
Then come the project-specific search paths.
-
Then the scene graph, with materials, hierarchy, parameter data, etc.
-
Then a list of FX Composer objects/plug-ins required to
successfully
display this package.
-
Last in the file come the original paths of the media objects in the .fxcomposer
compressed zip, so FX Composer knows where they were originally stored.
Full paths to all media and .fx files are always stored in the
FX Composer package or project. When you open them, the current
behavior is that FX Composer will look for your original drive copies,
and if they aren't found, it will load the archived version into a 'MediaCache'
directory underneath the main binary. If found, you'll be prompted to
use the alternative. This behavior is configurable under
File... Settings.
|