mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +02:00
Merge pull request #1105 from HifiExperiments/colorspace
add a setting to workaround the GLES colorspace conversion issue
This commit is contained in:
commit
fb81ad6c83
6 changed files with 32 additions and 12 deletions
|
@ -46,6 +46,7 @@
|
||||||
#include "avatar/AvatarManager.h"
|
#include "avatar/AvatarManager.h"
|
||||||
#include "avatar/AvatarPackager.h"
|
#include "avatar/AvatarPackager.h"
|
||||||
#include "AvatarBookmarks.h"
|
#include "AvatarBookmarks.h"
|
||||||
|
#include <display-plugins/OpenGLDisplayPlugin.h>
|
||||||
#include "DomainAccountManager.h"
|
#include "DomainAccountManager.h"
|
||||||
#include "MainWindow.h"
|
#include "MainWindow.h"
|
||||||
#include "render/DrawStatus.h"
|
#include "render/DrawStatus.h"
|
||||||
|
@ -549,6 +550,13 @@ Menu::Menu() {
|
||||||
drawStatusConfig, SLOT(setShowFade(bool)));
|
drawStatusConfig, SLOT(setShowFade(bool)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
action = addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::ExtraLinearTosRGBConversion, 0, OpenGLDisplayPlugin::getExtraLinearToSRGBConversion());
|
||||||
|
connect(action, &QAction::triggered, [action] {
|
||||||
|
OpenGLDisplayPlugin::setExtraLinearToSRGBConversion(action->isChecked());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Developer > Assets >>>
|
// Developer > Assets >>>
|
||||||
// Menu item is not currently needed but code should be kept in case it proves useful again at some stage.
|
// Menu item is not currently needed but code should be kept in case it proves useful again at some stage.
|
||||||
//#define WANT_ASSET_MIGRATION
|
//#define WANT_ASSET_MIGRATION
|
||||||
|
|
|
@ -237,7 +237,8 @@ namespace MenuOption {
|
||||||
const QString ComputeBlendshapes = "Compute Blendshapes";
|
const QString ComputeBlendshapes = "Compute Blendshapes";
|
||||||
const QString HighlightTransitions = "Highlight Transitions";
|
const QString HighlightTransitions = "Highlight Transitions";
|
||||||
const QString MaterialProceduralShaders = "Enable Procedural Materials";
|
const QString MaterialProceduralShaders = "Enable Procedural Materials";
|
||||||
}
|
const QString ExtraLinearTosRGBConversion = "Extra Linear to sRGB Conversion";
|
||||||
|
}
|
||||||
|
|
||||||
#endif // hifi_Menu_h
|
#endif // hifi_Menu_h
|
||||||
|
|
||||||
|
|
|
@ -112,14 +112,6 @@ bool Basic2DWindowOpenGLDisplayPlugin::internalActivate() {
|
||||||
return Parent::internalActivate();
|
return Parent::internalActivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
gpu::PipelinePointer Basic2DWindowOpenGLDisplayPlugin::getRenderTexturePipeline() {
|
|
||||||
#if defined(Q_OS_ANDROID)
|
|
||||||
return _linearToSRGBPipeline;
|
|
||||||
#else
|
|
||||||
return _drawTexturePipeline;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void Basic2DWindowOpenGLDisplayPlugin::compositeExtra() {
|
void Basic2DWindowOpenGLDisplayPlugin::compositeExtra() {
|
||||||
#if defined(Q_OS_ANDROID)
|
#if defined(Q_OS_ANDROID)
|
||||||
auto& virtualPadManager = VirtualPad::Manager::instance();
|
auto& virtualPadManager = VirtualPad::Manager::instance();
|
||||||
|
|
|
@ -37,8 +37,6 @@ public:
|
||||||
|
|
||||||
virtual void pluginUpdate() override {};
|
virtual void pluginUpdate() override {};
|
||||||
|
|
||||||
virtual gpu::PipelinePointer getRenderTexturePipeline() override;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
mutable bool _isThrottled = false;
|
mutable bool _isThrottled = false;
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include <gl/GLEscrow.h>
|
#include <gl/GLEscrow.h>
|
||||||
#include <gl/Context.h>
|
#include <gl/Context.h>
|
||||||
#include <gl/OffscreenGLCanvas.h>
|
#include <gl/OffscreenGLCanvas.h>
|
||||||
|
#include <gl/GLHelpers.h>
|
||||||
|
|
||||||
#include <gpu/Texture.h>
|
#include <gpu/Texture.h>
|
||||||
#include <gpu/FrameIO.h>
|
#include <gpu/FrameIO.h>
|
||||||
|
@ -57,6 +58,8 @@ using namespace shader::gpu::program;
|
||||||
|
|
||||||
extern QThread* RENDER_THREAD;
|
extern QThread* RENDER_THREAD;
|
||||||
|
|
||||||
|
Setting::Handle<bool> OpenGLDisplayPlugin::_extraLinearToSRGBConversionSetting("extraLinearToSRGBConversion", false);
|
||||||
|
|
||||||
class PresentThread : public QThread, public Dependency {
|
class PresentThread : public QThread, public Dependency {
|
||||||
using Mutex = std::mutex;
|
using Mutex = std::mutex;
|
||||||
using Condition = std::condition_variable;
|
using Condition = std::condition_variable;
|
||||||
|
@ -956,5 +959,16 @@ void OpenGLDisplayPlugin::copyTextureToQuickFramebuffer(NetworkTexturePointer ne
|
||||||
}
|
}
|
||||||
|
|
||||||
gpu::PipelinePointer OpenGLDisplayPlugin::getRenderTexturePipeline() {
|
gpu::PipelinePointer OpenGLDisplayPlugin::getRenderTexturePipeline() {
|
||||||
return _drawTexturePipeline;
|
#ifdef USE_GLES
|
||||||
|
if (!_extraLinearToSRGBConversionSetting.isSet()) {
|
||||||
|
const gl::ContextInfo &contextInfo = gl::ContextInfo::get();
|
||||||
|
_extraLinearToSRGBConversionSetting.set(std::find(contextInfo.extensions.cbegin(), contextInfo.extensions.cend(), "GL_EXT_framebuffer_sRGB") == contextInfo.extensions.cend());
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (getExtraLinearToSRGBConversion()) {
|
||||||
|
return _linearToSRGBPipeline;
|
||||||
|
} else {
|
||||||
|
return _drawTexturePipeline;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include <QtGui/QImage>
|
#include <QtGui/QImage>
|
||||||
|
|
||||||
#include <GLMHelpers.h>
|
#include <GLMHelpers.h>
|
||||||
|
#include <SettingHandle.h>
|
||||||
#include <SimpleMovingAverage.h>
|
#include <SimpleMovingAverage.h>
|
||||||
#include <shared/RateCounter.h>
|
#include <shared/RateCounter.h>
|
||||||
|
|
||||||
|
@ -86,6 +87,9 @@ public:
|
||||||
QOpenGLFramebufferObject* target,
|
QOpenGLFramebufferObject* target,
|
||||||
GLsync* fenceSync) override;
|
GLsync* fenceSync) override;
|
||||||
|
|
||||||
|
static void setExtraLinearToSRGBConversion(bool value) { _extraLinearToSRGBConversionSetting.set(value); }
|
||||||
|
static bool getExtraLinearToSRGBConversion() { return _extraLinearToSRGBConversionSetting.get(); };
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
friend class PresentThread;
|
friend class PresentThread;
|
||||||
|
|
||||||
|
@ -201,4 +205,7 @@ protected:
|
||||||
|
|
||||||
QImage getScreenshot(float aspectRatio);
|
QImage getScreenshot(float aspectRatio);
|
||||||
QImage getSecondaryCameraScreenshot();
|
QImage getSecondaryCameraScreenshot();
|
||||||
|
|
||||||
|
private:
|
||||||
|
static Setting::Handle<bool> _extraLinearToSRGBConversionSetting;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue