mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-18 04:44:16 +02:00
Exposing emmisive property of the Image3DOverlay
This commit is contained in:
parent
3e1e85aa18
commit
8e7a2ac536
2 changed files with 15 additions and 4 deletions
|
@ -26,14 +26,16 @@
|
|||
QString const Image3DOverlay::TYPE = "image3d";
|
||||
|
||||
Image3DOverlay::Image3DOverlay() {
|
||||
_isLoaded = false;
|
||||
_isLoaded = false;
|
||||
_emmisive = false;
|
||||
}
|
||||
|
||||
Image3DOverlay::Image3DOverlay(const Image3DOverlay* image3DOverlay) :
|
||||
Billboard3DOverlay(image3DOverlay),
|
||||
_url(image3DOverlay->_url),
|
||||
_texture(image3DOverlay->_texture),
|
||||
_fromImage(image3DOverlay->_fromImage)
|
||||
_fromImage(image3DOverlay->_fromImage),
|
||||
_emmisive(image3DOverlay->_emmisive)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -93,8 +95,8 @@ void Image3DOverlay::render(RenderArgs* args) {
|
|||
|
||||
batch->setModelTransform(transform);
|
||||
batch->setResourceTexture(0, _texture->getGPUTexture());
|
||||
|
||||
DependencyManager::get<DeferredLightingEffect>()->bindSimpleProgram(*batch, true, false, false, true);
|
||||
|
||||
DependencyManager::get<DeferredLightingEffect>()->bindSimpleProgram(*batch, true, false, _emmisive, true);
|
||||
DependencyManager::get<GeometryCache>()->renderQuad(
|
||||
*batch, topLeft, bottomRight, texCoordTopLeft, texCoordBottomRight,
|
||||
glm::vec4(color.red / MAX_COLOR, color.green / MAX_COLOR, color.blue / MAX_COLOR, alpha)
|
||||
|
@ -144,6 +146,11 @@ void Image3DOverlay::setProperties(const QScriptValue &properties) {
|
|||
setClipFromSource(subImageRect);
|
||||
}
|
||||
}
|
||||
|
||||
QScriptValue emmisiveValue = properties.property("emmisive");
|
||||
if (emmisiveValue.isValid()) {
|
||||
_emmisive = emmisiveValue.toBool();
|
||||
}
|
||||
}
|
||||
|
||||
QScriptValue Image3DOverlay::getProperty(const QString& property) {
|
||||
|
@ -156,6 +163,9 @@ QScriptValue Image3DOverlay::getProperty(const QString& property) {
|
|||
if (property == "offsetPosition") {
|
||||
return vec3toScriptValue(_scriptEngine, getOffsetPosition());
|
||||
}
|
||||
if (property == "emmisive") {
|
||||
return _emmisive;
|
||||
}
|
||||
|
||||
return Billboard3DOverlay::getProperty(property);
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ public:
|
|||
private:
|
||||
QString _url;
|
||||
NetworkTexturePointer _texture;
|
||||
bool _emmisive;
|
||||
|
||||
QRect _fromImage; // where from in the image to sample
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue