Can I use dataurl for instead of map image?

Below is a part of a material I downloaded from editor.

    "diffuse": [
        0.1568627450980392,
        0.1568627450980392,
        0.1568627450980392
    ],
    "diffuseMap": "../47415185/CARPET.png",

The diffuseMap value is a relative path against the map json file.
Can I use dataurl of image for the map?

Hi @sooyong_Kim,

I am not sure if the asset registry can parse and load a material .json resource that contains a base64 image.

If not, you can definitely parse and load it in your code, check this, it’s for an audio asset but the logic is the same:

I’ve just tried this in a project and unfortunately, this is not possible to use a base64 URI in the material JSON at the moment.

Added support for this here: https://github.com/playcanvas/engine/pull/3159

2 Likes