In a game asset pipeline, what is the difference between importing a source asset and cooking it for a target platform?
answer
- two conversions at two moments
- editor-side vs runtime-side data
- platform-neutral intermediate first
- per-platform formats, layout, stripped data
basics
~20 sImporting turns an artist's source file into a platform-neutral editor asset with its settings, often with a stable ID; cooking converts that asset into the runtime bytes one platform loads fastest, stripping editor-only data and baking in platform-specific encodings.
solid answer
~40 s**Import** runs when a source file changes: it reads the authoring format (a layered image, an exported mesh scene) and writes an engine-owned intermediate plus metadata such as import settings and, in many engines, a stable identifier. That intermediate is the same for every platform and is what the editor works with. **Cooking** runs once per target platform: it compresses textures into the formats that platform's GPU samples, lays meshes out in the vertex layout its renderer expects, compiles shaders for it, strips editor-only data, matches its endianness and alignment, and packs the results into archives. The shipped game never parses source files, because that would cost load time, memory and code it does not need, and because each platform wants different bytes.
go deeper
Recall the split: import makes a platform-neutral editor asset from a source file, cooking makes load-ready runtime data for one platform.
Explain what each step actually does to a texture or mesh, and why the cooked output is per platform while the imported intermediate is shared.
Connect the split to production pain: where conversion time goes, which data is stripped, and how a single changed source file is re-imported and re-cooked for hot reload.
Frame the split as an ownership boundary: what the editor team and the platform teams each control, and how many platforms multiply cook cost.
## Two conversions at two moments An asset pipeline is the chain of tools that turns what artists and designers author into what the game loads. Most engines split it into two conversions that run at different moments and for different consumers: - **Import** happens when a source file is added or changes. Its consumer is the editor. - **Cooking** (also called baking or building content) happens when a playable build for a specific platform is made. Its consumer is the runtime on that platform. Engines name these stages differently, and some fold the per-platform conversion into what they call import and cache one result per target; the two jobs are the same whatever they are called. Keeping them apart is what lets one set of source files feed several platforms without anyone editing per-platform copies by hand. ## What import does Source files are written by content-creation tools in their own formats: a layered paint file, an exported mesh scene with cameras and lights the game does not want, a high-sample-rate audio recording. Import reads one of these and writes an **intermediate asset** the engine owns. Along the way it typically: 1. parses the authoring format and keeps only what the engine understands (pixels, vertices, skeleton bindings, audio samples); 2. records **import settings** next to the asset, such as whether a texture is a colour map or a normal map, or how a mesh should be scaled; 3. assigns or reads a **stable identifier** so other assets can refer to this one even if its file moves; 4. stores everything in a platform-neutral form, often at full precision. The editor works from these intermediates and their settings, though some editors also display a version converted for the platform being previewed. They are convenient to edit, but they are not what a console or phone should load. ## What cooking does Cooking takes the intermediate assets that a build needs and converts each one into the **runtime format** for one platform. Typical steps include: - compressing textures into the block-compressed formats that platform's GPU can sample directly, and dropping resolution where the platform's memory budget demands it; - reordering mesh data into the vertex layout and index width that platform's renderer expects; - compiling shaders for that platform's GPU family; - converting audio to the codec the platform decodes cheaply; - **stripping editor-only data** such as thumbnails, source settings and debugging names; - writing structures with the target's **endianness, alignment and pointer size**, so they can be read with little or no parsing; - packing many small files into a few large archives, so the device makes fewer, larger reads. Because each step depends on the target, a build for each platform has its own cook output. The platform-neutral conversion, by contrast, needs to run only once no matter how many platforms ship. | | Import | Cook | |---|---|---| | Runs when | a source file changes | a build for a platform is made | | Runs how often | once per source change | once per source change, per platform | | Output is for | the editor | the shipped runtime | | Output format | platform-neutral intermediate | platform-specific, load-ready | | Keeps editor data | yes | no | ## Why the game does not load source files directly It is tempting on a small project to load the original image or mesh file at run time. It stops scaling for several reasons: 1. **Load time.** Parsing a general-purpose authoring format and converting it at run time costs CPU on every launch, on the slowest hardware the game supports. 2. **Wrong bytes.** The GPU wants compressed texture blocks and a specific vertex layout; the source file has neither, so the conversion would run on the player's device every time. 3. **Size.** Source files carry layers, history and precision the game never shows, which inflates downloads and memory. 4. **Code.** Every parser shipped in the runtime is more code to load, maintain and secure. ## Where this shows up in interviews Interviewers ask this early because the answer shows whether a candidate has seen a real pipeline. Weak answers merge the two steps or claim a single cooked build can run everywhere. Strong answers mention the stable identifier assigned at import, the per-platform nature of cooking, and the follow-on problems that make pipelines hard at scale: cooks that take hours, caches of derived data, and **hot reload**, where the editor notices a changed source file, re-imports it, converts just that asset for the running game, and swaps it into the running game without a restart.
- Why must a pipeline keep platform-neutral data even when the editor previews platform-converted assets?Cooked data is shaped for one platform and has editor-only information stripped out: names, source settings, thumbnails and full-precision values. Re-converting for another platform, or after a settings change, needs that information and the lossless data. So pipelines keep the source plus settings, or a platform-neutral intermediate, as the master copy, and treat every platform's converted output as derived and disposable.
- What makes cooked output differ between two platforms built from identical source assets?Each platform's GPU samples different compressed texture formats, its renderer may want a different vertex layout, its shaders compile for a different GPU family, and its CPU may differ in endianness, alignment or pointer size. Memory budgets also differ, so a smaller device may cook textures at lower resolution or drop detail levels. The same source therefore yields a separate cooked set per platform.
- The shipped game should load the artists' source files directly at run time.
- Import and cook are the same step with two different names.
- One cooked build can be copied unchanged to every platform.
- Cooking only compresses data; it never changes layout or strips anything.
- Editor-only data costs nothing in a shipped build, so stripping it is optional.