Skip to main content

setSkybox

Sets the skybox for the world.

Syntax

engine.world.setSkybox(props);

Parameters

NameTypeDescription
propsSkyboxProps, url or nullSkybox props or null to remove the skybox.

Example

// method #1 Using a cubemap
engine.world.setSkybox({
top: 'skybox/top.png',
bottom: 'skybox/bottom.png',
left: 'skybox/left.png',
right: 'skybox/right.png',
front: 'skybox/front.png',
back: 'skybox/back.png',
});

// method #2 | Using a cubemap
engine.world.setSkybox({
px: 'skybox/px.png',
nx: 'skybox/nx.png',
py: 'skybox/py.png',
ny: 'skybox/ny.png',
pz: 'skybox/pz.png',
nz: 'skybox/nz.png',
});

// method #3 | using a HDR
engine.world.setSkybox({
url: 'https://example.com/skybox.hdr',
isHdr: true,
});

// method #4 | using a PNG
engine.world.setSkybox('https://example.com/skybox.png');

Available on: Client