diff --git a/libraries/model/src/model/Skybox.cpp b/libraries/model/src/model/Skybox.cpp index bfbc883978..4901a3c61b 100755 --- a/libraries/model/src/model/Skybox.cpp +++ b/libraries/model/src/model/Skybox.cpp @@ -26,13 +26,15 @@ Skybox::Skybox() { } void Skybox::setColor(const Color& color) { - _empty = false; _schemaBuffer.edit().color = color; + _empty = false; } void Skybox::setCubemap(const gpu::TexturePointer& cubemap) { - _empty = false; _cubemap = cubemap; + if (cubemap) { + _empty = false; + } } void Skybox::updateSchemaBuffer() const { @@ -52,9 +54,9 @@ void Skybox::updateSchemaBuffer() const { } void Skybox::clear() { - _empty = true; _schemaBuffer.edit().color = vec3(0); - setCubemap(nullptr); + _cubemap = nullptr; + _empty = true; } void Skybox::prepare(gpu::Batch& batch, int textureSlot, int bufferSlot) const {