This commit is contained in:
parent
c466d90eec
commit
f442caa888
6 changed files with 224 additions and 11 deletions
|
|
@ -36,4 +36,26 @@ namespace Crafter {
|
|||
// support requires a self-host rebuild via crafter-build itself,
|
||||
// which resolves the Crafter.Asset dep through project.cpp.
|
||||
export CRAFTER_API std::string CompressAsset(const fs::path& input, const fs::path& output);
|
||||
|
||||
// Split a single .obj + .mtl file by material group into per-material
|
||||
// .cmesh files, per-unique-albedo .ctex files, and a scene.txt manifest
|
||||
// under outDir. All albedo textures are resized to albedoSize × albedoSize
|
||||
// before compression (required for a texture_2d_array where all layers
|
||||
// must have identical dimensions).
|
||||
//
|
||||
// scene.txt format (read by the Sponza example at runtime):
|
||||
// <albedoCount>
|
||||
// <meshCount>
|
||||
// <albedoIdx_for_mesh_0> (-1 = no albedo)
|
||||
// ...
|
||||
//
|
||||
// Idempotent: returns "" immediately if outDir/scene.txt already exists,
|
||||
// so repeated builds skip the expensive split+resize step.
|
||||
// Returns "" on success, an error string on failure.
|
||||
export CRAFTER_API std::string BuildOBJBundle(
|
||||
const fs::path& objPath,
|
||||
const fs::path& mtlPath,
|
||||
const fs::path& outDir,
|
||||
std::uint16_t albedoSize = 1024
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,4 +97,14 @@ export namespace Crafter {
|
|||
// recursively LoadProject's it. Returns a stable Configuration* owned
|
||||
// by the same internal cache as GitProject.
|
||||
CRAFTER_API Configuration* LocalProject(const LocalProjectSpec& spec);
|
||||
|
||||
// Clone (or update) the given git source into the shared external
|
||||
// cache and return the path to the cloned working tree. Intended for
|
||||
// example projects that need large asset bundles which shouldn't
|
||||
// live in the parent repo — push the returned path (or specific
|
||||
// files inside it) into `cfg.assets`. Reuses the same cache root as
|
||||
// ExternalDependency / GitProject. Caching key = url + branch + commit;
|
||||
// identical calls reuse the existing clone. Pin `source.commit` to a
|
||||
// SHA for reproducible, offline-after-first-fetch builds.
|
||||
CRAFTER_API fs::path GitFetch(const GitSource& source);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue