Asset: Difference between revisions

From Resonite Wiki
Added information of deduplication. Added more information about metadata, added fonts to the list of assets. rearranged some sections.
add important info on URIs
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{stub}}
{{stub}}


an '''Asset''' in the context of [[Resonite]], is an object that represents content, either from a user importing it or built into resonite.
An '''Asset''', is any object within a Resonite Creation that is not stored within the Resonite [[Data Model]].


== Examples ==
Some examples of assets are:
Some examples of assets are:
{| class="wikitable"
{| class="wikitable"
Line 8: Line 9:
! Asset Type !! Description
! Asset Type !! Description
|-
|-
| Texture || a 2D image.
| Texture/Image || Images/textures.
|-
|-
| Audio || audio data asset.
| Audio || Sound Effects and other sound sources
|-
|-
| Font || the style used to show text
| Font || Font files used for rendering text
|-
|-
| Mesh || Mesh information, the triangles that make up a model etc.
|}
|}


== Deduplication ==
== Asset Saving ==
When assets are saved in an item, world, or avatar, the asset types are identified via URI.


Assets are deduplicated, which means that an asset saved in your inventory multiple times will only be counted against you once. Assets that have been changed (no matter how small, like one pixel change in a texture), the hash would be completely different, and would be counted against your storage.
The gathering is as follows:
* The saving mechanism for the data saver adds every URL from every value field possible to its URLNodes</code> list (uses the <code>Elements.Core.DataTreeValue.IsURL</code> check) this means any [[Type:Uri|Uri]] field regardless of where it is on an item is counted as the URI being used in an item as an asset, even if its not part of an asset component. (Yes even just a [[Component:ValueField|ValueField]]<[[Type:Uri|Uri]]> counts)
* the saver then checks to see for every url in <code>URLNodes</code> starts with <code>resdb</code>, and if it doesn't, computes the "cloud signature" resdb url, which is a sha-256 hash of the asset's data.
* The data for every <code>URLNodes</code> if it is a "local" scheme is finally uploaded to the cloud, and if a local asset has an identical version on the cloud, it is not reuploaded and instead the cloud version is used.


{{Note|Don't worry too much of how much an item takes up when it is shown in the [[Inventory]] of the [[Dash]]. This just shows how much it would take if it (or its parts) were not dedulplicated.|warning}}
 
== Non-Assets ==
It can often be unclear what is an isn't an asset. Some commonly mistaken items are:
 
* Materials
** These are not assets but instead objects within the Resonite [[Data Model]] that link directly to [[Shaders]].
* Slots
** These are part of the Resonite [[Data Model]] itself.
 
== Asset Variants ==
 
Assets you bring into Resonite will eventually have variants created for them through the [[Asset_Variant|asset variant system]]. Variants, are used to make Resonite content more performant or efficient.
 
== De-duplication ==
 
Assets are de-duplicated, an asset saved in your inventory multiple times will only be counted against your storage quota once. De-duplication is based on the [[Hash]] of the Asset so any change, however small could result in an additional asset stored which does count against your storage quota.
 
{{Note|The space shown in the [[Inventory]] tab of the [[Dash]] for a Resonite creation shows how much it would take if it (or its parts) were not de-duplicated.|warning}}


== Importing ==
== Importing ==


Users can [[Importing Assets|import]] many different asset types, either by pasting Ctrl+V, using the [[File Browser]], or dragging and dropping it into Resonite itself, and then using the Resonite dialog to bring it in. As long as the file type is [[Supported Formats|supported]], Resonite will process it.
Users can [[Importing Assets|import]] assets, either by pasting the asset from their clipboard, using the [[File Browser]], or dragging and dropping them into Resonite itself. As long as the file type is [[Supported Formats|supported]], Resonite will process it.


== Exporting ==
== Exporting ==


Assets and data can be brought out of Resonite in many different ways:
Assets and data can be exported from Resonite in many different ways:
* The [[File Browser]]
* The [[File Browser]]
* Exporting from the [[Context menu|Context Menu]]
* Exporting from the [[Context menu|Context Menu]]
Line 37: Line 60:


== Types ==
== Types ==
 
<!-- TODO: De-duplicate with the examples table above -->
Assets are used in [[Type:IAssetProvider`1|IAssetProviders]] are used to reference an asset like a [[Reference Type|reference type]] in [[Component|components]] and [[ProtoFlux]].
Assets are used in [[Type:IAssetProvider`1|IAssetProviders]] are used to reference an asset like a [[Reference Type|reference type]] in [[Component|components]] and [[ProtoFlux]].



Latest revision as of 22:33, 21 February 2025

This article or section is a Stub. You can help the Resonite Wiki by expanding it.

An Asset, is any object within a Resonite Creation that is not stored within the Resonite Data Model.

Examples

Some examples of assets are:

Asset Type Description
Texture/Image Images/textures.
Audio Sound Effects and other sound sources
Font Font files used for rendering text
Mesh Mesh information, the triangles that make up a model etc.

Asset Saving

When assets are saved in an item, world, or avatar, the asset types are identified via URI.

The gathering is as follows:

  • The saving mechanism for the data saver adds every URL from every value field possible to its URLNodes list (uses the Elements.Core.DataTreeValue.IsURL check) this means any Uri field regardless of where it is on an item is counted as the URI being used in an item as an asset, even if its not part of an asset component. (Yes even just a ValueField<Uri> counts)
  • the saver then checks to see for every url in URLNodes starts with resdb, and if it doesn't, computes the "cloud signature" resdb url, which is a sha-256 hash of the asset's data.
  • The data for every URLNodes if it is a "local" scheme is finally uploaded to the cloud, and if a local asset has an identical version on the cloud, it is not reuploaded and instead the cloud version is used.


Non-Assets

It can often be unclear what is an isn't an asset. Some commonly mistaken items are:

  • Materials
    • These are not assets but instead objects within the Resonite Data Model that link directly to Shaders.
  • Slots

Asset Variants

Assets you bring into Resonite will eventually have variants created for them through the asset variant system. Variants, are used to make Resonite content more performant or efficient.

De-duplication

Assets are de-duplicated, an asset saved in your inventory multiple times will only be counted against your storage quota once. De-duplication is based on the Hash of the Asset so any change, however small could result in an additional asset stored which does count against your storage quota.

The space shown in the Inventory tab of the Dash for a Resonite creation shows how much it would take if it (or its parts) were not de-duplicated.

Importing

Users can import assets, either by pasting the asset from their clipboard, using the File Browser, or dragging and dropping them into Resonite itself. As long as the file type is supported, Resonite will process it.

Exporting

Assets and data can be exported from Resonite in many different ways:

Types

Assets are used in IAssetProviders are used to reference an asset like a reference type in components and ProtoFlux.

This is often useful when using complex types.

Metadata

Assets contain metadata and this can be used to access information about the asset. You can use Components to get or set this metadata information.

Assets In Worlds

Assets are usually stored in the Assets Slot in a world, and are regularly garbage collected to optimize a world.