set skybox clear color to empty color

This commit is contained in:
Zach Pomerantz 2016-08-25 18:08:03 -07:00
parent 24162f0f3d
commit 5e82093e69
2 changed files with 6 additions and 1 deletions

View file

@ -49,6 +49,11 @@ void Skybox::updateSchemaBuffer() const {
}
}
void Skybox::clear() {
_schemaBuffer.edit<Schema>().color = vec3(0);
setCubemap(nullptr);
}
void Skybox::prepare(gpu::Batch& batch, int textureSlot, int bufferSlot) const {
if (bufferSlot > -1) {
batch.setUniformBuffer(bufferSlot, _schemaBuffer);

View file

@ -36,7 +36,7 @@ public:
const gpu::TexturePointer& getCubemap() const { return _cubemap; }
virtual bool empty() { return _schemaBuffer.get<Schema>().color == vec3(0) && !_cubemap; }
virtual void clear() { setCubemap(nullptr); }
virtual void clear();
void prepare(gpu::Batch& batch, int textureSlot = SKYBOX_SKYMAP_SLOT, int bufferSlot = SKYBOX_CONSTANTS_SLOT) const;
virtual void render(gpu::Batch& batch, const ViewFrustum& frustum) const;