-
Couldn't load subscription status.
- Fork 67
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 tosystemin the future) -
glsl(if we create such a namespace)
This is to ensure that assets 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::extnamespaces) then it must be serializable into/from.bawfile 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
assets 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
assetsneeded for a root asset are present - There are no "logical gaps" in the chain above, i.e. all dependent
assetscan 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
ICPUMeshin the whole file - If the root asset is an
ICPUTexturethen there are noICPUBuffers that are not indirectly or directly refereced by that oneICPUTexturewhich is the root asset - If root asset is
ICPUMeshthen an appropriate numberIMeshBuffers is present with correct handles, and so are theICPUBuffersetc. etc. - The created
ICPUTextureneeds to reference the createdCImageSubImageDatas which must themselved be valid assets on their own.