diff --git a/src/plugins/minimal_scene/EngineToQtInterface.cc b/src/plugins/minimal_scene/EngineToQtInterface.cc index 8e82576ff..d0256f889 100644 --- a/src/plugins/minimal_scene/EngineToQtInterface.cc +++ b/src/plugins/minimal_scene/EngineToQtInterface.cc @@ -136,7 +136,12 @@ GLuint EngineToQtInterface::TextureId(gz::rendering::CameraPtr &_camera) { if (!this->NeedsFallback(_camera)) { - return _camera->RenderTextureGLId(); + auto textureId = _camera->RenderTextureGLId(); + + QOpenGLFunctions *glFuncs = this->dataPtr->glContext->functions(); + glFuncs->glBindTexture(GL_TEXTURE_2D, textureId); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SRGB_DECODE_EXT, GL_SKIP_DECODE_EXT); + return textureId; } else { diff --git a/src/plugins/minimal_scene/MinimalScene.cc b/src/plugins/minimal_scene/MinimalScene.cc index 556ea8e10..2a7fb7bd9 100644 --- a/src/plugins/minimal_scene/MinimalScene.cc +++ b/src/plugins/minimal_scene/MinimalScene.cc @@ -1545,12 +1545,6 @@ void MinimalScene::LoadConfig(const tinyxml2::XMLElement *_pluginElem) } renderWindow->SetEngineName(cmdRenderEngine); - // there is a problem with displaying ogre2 render textures that are in - // sRGB format. Workaround for now is to apply gamma correction - // manually. - // There maybe a better way to solve the problem by making OpenGL calls. - if (cmdRenderEngine == std::string("ogre2")) - this->PluginItem()->setProperty("gammaCorrect", true); } ///////////////////////////////////////////////// diff --git a/src/plugins/minimal_scene/MinimalScene.qml b/src/plugins/minimal_scene/MinimalScene.qml index 5969a31c6..62919ec79 100644 --- a/src/plugins/minimal_scene/MinimalScene.qml +++ b/src/plugins/minimal_scene/MinimalScene.qml @@ -25,11 +25,6 @@ Rectangle { Layout.minimumHeight: 200 anchors.fill: parent - /** - * True to enable gamma correction - */ - property bool gammaCorrect: false - /** * Get mouse position on 3D widget */ @@ -54,16 +49,6 @@ Rectangle { visible: MinimalScene.loadingError.length == 0 } - /* - * Gamma correction for sRGB output. Enabled when engine is set to ogre2 - */ - GammaAdjust { - anchors.fill: renderWindow - source: renderWindow - gamma: 2.4 - enabled: gammaCorrect - visible: gammaCorrect - } onParentChanged: { if (undefined === parent)