Assets are resources that are available to use in your game. Assets can be of various different content types, for example, 3D models or audio files. They come in two different forms: Source and Target.
After uploading a file for an Asset the file is run through the importing pipeline which converts and optimizes the data for final use in the game.
PlayCanvas supports the importing of a wide variety of content types:
- Models e.g. FBX, COLLADA, obj
- 3D Animations
- Images for textures e.g. jpg, png
- Audio e.g. mp3, ogg
When you upload a new file the asset type will be set automatically from the type of file you've uploaded. For example, if you upload a PNG file, the Asset created will be a texture type.
Source Assets and Target Assets
After the asset type, then next most important property of an Asset is whether it is a Source Asset or a Target Asset.
Put simply, Source Assets reference the original files that you uploaded. Target Assets are created at the end of the import pipeline for any files that have been generated by the PlayCanvas conversion and optimization process.
For example, if you upload a Photoshop (PSD) file for a texture, we create a Source Asset of type texture for that PSD file. Then we run the import pipeline and convert the PSD file into a JPG file. At the end of the process we create a Target Asset of type texture for the new JPG file.
In the Editor and in your game, you will only ever be referring to Target Assets. That is because they are in formats optimized and ready to use at runtime.