Only add buffer/tex to skymap if asked for

This commit is contained in:
Zach Pomerantz 2016-03-10 22:52:44 -08:00
parent 25607709a5
commit 4dad797e20

View file

@ -50,13 +50,17 @@ void Skybox::updateSchemaBuffer() const {
}
void Skybox::prepare(gpu::Batch& batch, int textureSlot, int bufferSlot) const {
if (bufferSlot > -1) {
batch.setUniformBuffer(bufferSlot, _schemaBuffer);
}
if (textureSlot > -1) {
gpu::TexturePointer skymap = getCubemap();
// FIXME: skymap->isDefined may not be threadsafe
if (skymap && skymap->isDefined()) {
batch.setResourceTexture(textureSlot, skymap);
}
}
}
void Skybox::render(gpu::Batch& batch, const ViewFrustum& frustum) const {