diff --git a/commons/src/main/com/mbrlabs/mundus/commons/Scene.java b/commons/src/main/com/mbrlabs/mundus/commons/Scene.java index 648a9e54c..4a7c3ded2 100644 --- a/commons/src/main/com/mbrlabs/mundus/commons/Scene.java +++ b/commons/src/main/com/mbrlabs/mundus/commons/Scene.java @@ -259,7 +259,7 @@ protected void captureDepth(float delta) { } protected void renderSkybox() { - if (skybox != null) { + if (skybox != null && skybox.active) { batch.begin(cam); batch.render(skybox.getSkyboxInstance(), environment, skybox.shader); batch.end(); diff --git a/commons/src/main/com/mbrlabs/mundus/commons/skybox/Skybox.java b/commons/src/main/com/mbrlabs/mundus/commons/skybox/Skybox.java index 902e998fd..77b2fa0ef 100644 --- a/commons/src/main/com/mbrlabs/mundus/commons/skybox/Skybox.java +++ b/commons/src/main/com/mbrlabs/mundus/commons/skybox/Skybox.java @@ -37,6 +37,7 @@ public class Skybox implements Disposable { public static final float DEFAULT_ROTATE_SPEED = 0.1f; public Shader shader; + public boolean active; private Model boxModel; private ModelInstance boxInstance; @@ -56,6 +57,7 @@ public Skybox(FileHandle positiveX, FileHandle negativeX, FileHandle positiveY, FileHandle positiveZ, FileHandle negativeZ, Shader shader) { set(positiveX, negativeX, positiveY, negativeY, positiveZ, negativeZ); + this.active = true; this.shader = shader; boxModel = createModel(); boxInstance = new ModelInstance(boxModel);