-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
I would like to propose an extension for images, where the extension would contain a single field: "sha256" with an hexadecimal value representing the hash of the image referenced by the image object:
The purpose is this:
In games, it is quite common to have a global texture store and share textures between models.
The solution usually suggested is to compare the full load paths, but that's not always possible if, for example the textures are archived internally, or in other cases it can happen the resources are actually duplicated and we want to avoid redundant loads.
An authoring application only needs to calculate the sha256 of every image and add the extension.
On the client side, like a game engine, it would check whether the image has been loaded using the sha256 as a dictionary key.
as a bonus, this can be used to verify the image bytes.
This may look like adding an "ID" to the images, but in this particular extension, there's no ambiguities since both the extension naming, and how to define the value of the property is clearly defined.