Multi-Media Asset Pipeline¶
An asset pipeline is the process of creating, organizing, exporting, loading and testing a game's non-code resources: models, textures, materials, audio, fonts and scenes. Agree on formats and paths early so artists and developers can reproduce an export and test the same files.
Asset Pipeline¶
- Create models and materials in an authoring tool. For 3D assets, start with the Blender and glTF workflow and metallic-roughness PBR materials.
- Export a
.glbor a.gltfwith its external buffers and textures. Keep the relative paths from the export intact. - Place the complete export, sounds and other resources under the project resource root. Use meaningful names and a consistent folder structure.
- Load the asset in a small jMonkeyEngine scene. Check scale, orientation, normals, textures, animation and lighting, then verify it in a packaged build on the target platform.
- Profile real assets on target hardware. Adjust polygon counts, texture resolution and material complexity to the needs of the game; an appropriate budget depends on the scene and device.
Use version control for source and exported assets, document their origin and licenses, and avoid silently overwriting files that other assets reference. Asset Packs are another way to organize resources when using the SDK.
Use The Assets Folder¶
In a Gradle project generated by the Initializer the shared resource root is game-assets/src/main/assets. Asset keys are relative to the registered resource root, not to an arbitrary filesystem path. For example:
game-assets/src/main/assets/
Interface/ # fonts and UI images
MatDefs/ # material definitions
Materials/ # jMonkeyEngine material instances
Models/ # glTF models and their referenced resources
Scenes/ # scene assets
Shaders/ # shader sources
Sounds/ # audio
Textures/ # images used by the game
These names are conventions: choose a structure that works for the project and retain the references recorded by each model. For example, group a vehicle model and its textures under Models/vehicles/car1/, while related sounds can live under Sounds/vehicles/car1/. Agree on names for animated parts, clips and bones as well.
If a file is moved or renamed, update the corresponding asset keys and any model references. A FileLocator, ZIP locator or URL locator can access other roots when explicitly configured. See AssetManager.
Create Textures and Materials¶
Create textures in an image editor and save them at the paths used by the exported asset. A glTF material can reference separate base-color, normal, metallic-roughness, emissive and occlusion textures. These textures need not be combined into one image; use an atlas only when it benefits a particular asset or performance target.
You can also create a .j3m material instance for jMonkeyEngine. Place the material and its referenced images under registered resource roots and preserve their asset keys. Color space, texture channels, UVs, alpha mode and tangent data affect the result, so compare the exported model with the source in a representative scene.
Create 3D Models¶
Create and animate models in a tool such as Blender, using materials and features supported by your glTF exporter and the engine's importer. Unwrap UVs where textures need them; check normals and tangents for normal maps. Export animations and external files as needed.
An authoring tool and a real-time engine can produce different images because of lighting, environment probes, tone mapping, shadows, material features and color management. Recreate comparable conditions before deciding that a material is incorrect. See PBR and environment lighting, and check the specific glTF extensions used by an asset.
glTF and Optional .j3o Conversion¶
Load glTF models directly using assetManager.loadModel() and the jme3-plugins loader. A .glb is convenient for a single-file export; a .gltf can reference other files that must also be distributed. Projects generated by the Initializer package resources without requiring .j3o conversion.
Must I convert to .j3o?¶
No. .j3o is jMonkeyEngine's binary serialization format and can be useful for saving supported scene-graph objects, controls and user data. It can reference external asset keys, so keep the referenced resources available when reloading it. Use the SDK or BinaryExporter when that workflow suits your project; do not assume every external model must be converted.
Before distribution, inspect the actual output for each target and run it with the same resources and native modules it will ship with. A missing texture or model in a release is usually a packaging, path, loader or case-sensitivity issue; see the AssetManager troubleshooting section.