What is the best way to set a skybox to render last?

In order to avoid costly fragment calculations, I wish to render the skybox last, especially since much of the time, the user will be within a building where the skybox is not visible. What is the best way to set a skybox to render last?

either your create the mesh last in the scene :slight_smile:

Or you put it in a separate renderingGroup and call scene.setRenderingAutoClearDepthStencil to prevent clearing before rendering the skybox group.

1 Like

Actually the second options might have issues if you have transparent meshes in your scene so the first one might be better.

Thanks so much @sebavan . In my case there will be new models added sporadically, some of which may have transparency.

1 Like