I create a cubemap in the editor, how can I load it in the engine?

I create a cubemap in the editor, and I download the file into my project .
how can I load it in the engine ?
and how to set it as skybox ?

I saw the issue in the github : Support loading cubemap json · Issue #317 · playcanvas/engine · GitHub
when will it be fixed , or do I have any way to load a skybox in the engine ?

In the engine, you can create assets for the textures:

  var data = {
    "name": "forest",
    "cubemap": "your cubemap",
    "textures": [

var textures = data.textures.map(t => {
  var asset = new pc.Asset(t, 'texture',
    { url: t },
    { addressu: 'repeat', addressv : 'repeat' }
  return asset.id;

var cubemap = new pc.Asset(data.name, 'cubemap',
    data.cubemap ? { url: data.cubemap } : null, 
        anisotropy: 1,
        magFilter: 1,
        minFilter: 5,
        rgbm: true,
        textures: textures

1 Like

thanks for you help

I tried this code , but it doesn’t work, without any error

thanks for your help , I want to use the cubemap in engine-only

I’ve tested on codepen, it works well.