Moving Clouds in a skybox?

How would I achieve Moving Clouds in a skybox? Would I simply upload a .gif file as the skybox or something? I can’t information on how to achieve this anywhere.

Hi @futilegames and welcome,

You can use a GIF as a texture, you can potentially parse its frames and update a pc.Texture in realtime. Much like with a mp4 video:

https://developer.playcanvas.com/en/tutorials/video-textures/

That will give you a single texture, if you plan to use it for a skybox you will need 6, one for each side of the cube. It could work but it will be bad for performance.

Another way would be to write a custom shader that generates clouds in a pixel shader (advanced), either on a flat surface or override the skybox shader chunk.

Simpler ways would be to create billboard clouds using a texture, search online for 2D clouds as used in videogames.

Be cool if this engine made this process simpler somehow. But thanks for the advisement.

1 Like

You can also rotate the skybox or if you want to have a layered effect, consider inverted spheres/cubes and rotate them slowly.

1 Like

What do you mean by rotate them slowly? As in an animation?

As in rotate the mesh and/or sky box.

Ah ok

There’s an API to rotate the sky box on the scene object with a pc.Quat here: Scene | PlayCanvas API Reference

Eg

this.app.scene.skyboxRotation = someNewRotationQuat;

Makes sense, thanks.