-
Notifications
You must be signed in to change notification settings - Fork 58
Asset Pipeline Philosophy
Przemog1 edited this page Nov 2, 2020
·
2 revisions
According to our plans to split the library into 1 lib per-namespace and have a strict dependency DAG between them, anything in the asset
namespace can only depend on:
core
-
io
(renamed tosystem
in the future) -
glsl
(if we create such a namespace)
This is to ensure that asset
s are fully CPU objects, which can be manipulated without and irrespective of any video subsystem/implementation such as OpenGL, Vulkan, CUDA, OpenCL etc.
Its a hard requirement to enable offline preprocessing, or server-side manipulation on GPU-less servers.
The following are required properties of an asset
:
- If it does not come from an extension (
nbl::ext
namespaces) then it must be serializable into/from.baw
file format - It must be referencable by at least one other asset type, unless its a "top level asset" (ICPUMesh and derived right now, as we move towards more data driven rendering, this would be a render-graph root)
- It must be a valid self-contained object independent of its "parents" (the
asset
s that reference it), essentially if we cut the top of the asset DAG, we get valid independent DAGs.
The following also constrain the definition of an asset
due to required property of an asset
:
- There is only one root asset (can be any asset type)
- There are no "dead-ends", nothing not needed by the root asset is present in the file
- The full chain of dependent
assets
needed for a root asset are present - There are no "logical gaps" in the chain above, i.e. all dependent
assets
can be chained up (there is no missing information) by the loader without programmer intervention or a-priori knowledge of any parameters or relationships.
Examples (not limited to):
- Only one
ICPUMesh
in the whole file - If the root asset is an
ICPUTexture
then there are noICPUBuffer
s that are not indirectly or directly refereced by that oneICPUTexture
which is the root asset - If root asset is
ICPUMesh
then an appropriate numberIMeshBuffer
s is present with correct handles, and so are theICPUBuffers
etc. etc. - The created
ICPUTexture
needs to reference the createdCImageSubImageData
s which must themselved be valid assets on their own.