mirror of
https://github.com/overte-org/overte.git
synced 2025-08-11 11:33:07 +02:00
Only add buffer/tex to skymap if asked for
This commit is contained in:
parent
25607709a5
commit
4dad797e20
1 changed files with 9 additions and 5 deletions
|
@ -50,12 +50,16 @@ void Skybox::updateSchemaBuffer() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Skybox::prepare(gpu::Batch& batch, int textureSlot, int bufferSlot) const {
|
void Skybox::prepare(gpu::Batch& batch, int textureSlot, int bufferSlot) const {
|
||||||
batch.setUniformBuffer(bufferSlot, _schemaBuffer);
|
if (bufferSlot > -1) {
|
||||||
|
batch.setUniformBuffer(bufferSlot, _schemaBuffer);
|
||||||
|
}
|
||||||
|
|
||||||
gpu::TexturePointer skymap = getCubemap();
|
if (textureSlot > -1) {
|
||||||
// FIXME: skymap->isDefined may not be threadsafe
|
gpu::TexturePointer skymap = getCubemap();
|
||||||
if (skymap && skymap->isDefined()) {
|
// FIXME: skymap->isDefined may not be threadsafe
|
||||||
batch.setResourceTexture(textureSlot, skymap);
|
if (skymap && skymap->isDefined()) {
|
||||||
|
batch.setResourceTexture(textureSlot, skymap);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue