mirror of
https://github.com/lubosz/overte.git
synced 2025-08-08 03:08:00 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into restore-WebView-tab-handler
This commit is contained in:
commit
a48aced7bd
2 changed files with 8 additions and 5 deletions
|
@ -26,10 +26,12 @@ Skybox::Skybox() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Skybox::setColor(const Color& color) {
|
void Skybox::setColor(const Color& color) {
|
||||||
|
_empty = false;
|
||||||
_schemaBuffer.edit<Schema>().color = color;
|
_schemaBuffer.edit<Schema>().color = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Skybox::setCubemap(const gpu::TexturePointer& cubemap) {
|
void Skybox::setCubemap(const gpu::TexturePointer& cubemap) {
|
||||||
|
_empty = false;
|
||||||
_cubemap = cubemap;
|
_cubemap = cubemap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,6 +52,7 @@ void Skybox::updateSchemaBuffer() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Skybox::clear() {
|
void Skybox::clear() {
|
||||||
|
_empty = true;
|
||||||
_schemaBuffer.edit<Schema>().color = vec3(0);
|
_schemaBuffer.edit<Schema>().color = vec3(0);
|
||||||
setCubemap(nullptr);
|
setCubemap(nullptr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ public:
|
||||||
void setCubemap(const gpu::TexturePointer& cubemap);
|
void setCubemap(const gpu::TexturePointer& cubemap);
|
||||||
const gpu::TexturePointer& getCubemap() const { return _cubemap; }
|
const gpu::TexturePointer& getCubemap() const { return _cubemap; }
|
||||||
|
|
||||||
virtual bool empty() { return _schemaBuffer.get<Schema>().color == vec3(0) && !_cubemap; }
|
virtual bool empty() { return _empty; }
|
||||||
virtual void clear();
|
virtual void clear();
|
||||||
|
|
||||||
void prepare(gpu::Batch& batch, int textureSlot = SKYBOX_SKYMAP_SLOT, int bufferSlot = SKYBOX_CONSTANTS_SLOT) const;
|
void prepare(gpu::Batch& batch, int textureSlot = SKYBOX_SKYMAP_SLOT, int bufferSlot = SKYBOX_CONSTANTS_SLOT) const;
|
||||||
|
@ -47,17 +47,17 @@ protected:
|
||||||
static const int SKYBOX_SKYMAP_SLOT { 0 };
|
static const int SKYBOX_SKYMAP_SLOT { 0 };
|
||||||
static const int SKYBOX_CONSTANTS_SLOT { 0 };
|
static const int SKYBOX_CONSTANTS_SLOT { 0 };
|
||||||
|
|
||||||
gpu::TexturePointer _cubemap;
|
|
||||||
|
|
||||||
class Schema {
|
class Schema {
|
||||||
public:
|
public:
|
||||||
glm::vec3 color { 0.0f, 0.0f, 0.0f };
|
glm::vec3 color { 0.0f, 0.0f, 0.0f };
|
||||||
float blend { 0.0f };
|
float blend { 0.0f };
|
||||||
};
|
};
|
||||||
|
|
||||||
mutable gpu::BufferView _schemaBuffer;
|
|
||||||
|
|
||||||
void updateSchemaBuffer() const;
|
void updateSchemaBuffer() const;
|
||||||
|
|
||||||
|
mutable gpu::BufferView _schemaBuffer;
|
||||||
|
gpu::TexturePointer _cubemap;
|
||||||
|
bool _empty{ true };
|
||||||
};
|
};
|
||||||
typedef std::shared_ptr<Skybox> SkyboxPointer;
|
typedef std::shared_ptr<Skybox> SkyboxPointer;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue