mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-02 03:51:35 +02:00
fixed gamma on windows
This commit is contained in:
parent
1d3867d777
commit
4cf8023d0e
4 changed files with 23 additions and 3 deletions
|
@ -113,7 +113,15 @@ gpu::PipelinePointer Basic2DWindowOpenGLDisplayPlugin::getCompositeScenePipeline
|
||||||
#if defined(Q_OS_ANDROID)
|
#if defined(Q_OS_ANDROID)
|
||||||
return _compositePipeline;
|
return _compositePipeline;
|
||||||
#endif
|
#endif
|
||||||
return _drawTexturePipeline;
|
//return _drawTexturePipeline;
|
||||||
|
return _SRGBToLinearPipeline;
|
||||||
|
}
|
||||||
|
|
||||||
|
gpu::Element Basic2DWindowOpenGLDisplayPlugin::getCompositeFBColorSpace() {
|
||||||
|
#if defined(Q_OS_ANDROID)
|
||||||
|
return gpu::Element::COLOR_SRGBA_32;
|
||||||
|
#endif
|
||||||
|
return gpu::Element::COLOR_RGBA_32;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,7 @@ public:
|
||||||
virtual void pluginUpdate() override {};
|
virtual void pluginUpdate() override {};
|
||||||
|
|
||||||
virtual gpu::PipelinePointer getCompositeScenePipeline() override;
|
virtual gpu::PipelinePointer getCompositeScenePipeline() override;
|
||||||
|
virtual gpu::Element getCompositeFBColorSpace() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
mutable bool _isThrottled = false;
|
mutable bool _isThrottled = false;
|
||||||
|
|
|
@ -400,6 +400,9 @@ void OpenGLDisplayPlugin::customizeContext() {
|
||||||
{
|
{
|
||||||
_compositePipeline = gpu::Pipeline::create(gpu::Shader::createProgram(DrawTextureGammaLinearToSRGB), scissorState);
|
_compositePipeline = gpu::Pipeline::create(gpu::Shader::createProgram(DrawTextureGammaLinearToSRGB), scissorState);
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
_SRGBToLinearPipeline = gpu::Pipeline::create(gpu::Shader::createProgram(DrawTextureGammaSRGBToLinear), scissorState);
|
||||||
|
}
|
||||||
{
|
{
|
||||||
_hudPipeline = gpu::Pipeline::create(gpu::Shader::createProgram(DrawTexture), blendState);
|
_hudPipeline = gpu::Pipeline::create(gpu::Shader::createProgram(DrawTexture), blendState);
|
||||||
}
|
}
|
||||||
|
@ -914,10 +917,14 @@ void OpenGLDisplayPlugin::render(std::function<void(gpu::Batch& batch)> f) {
|
||||||
OpenGLDisplayPlugin::~OpenGLDisplayPlugin() {
|
OpenGLDisplayPlugin::~OpenGLDisplayPlugin() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gpu::Element OpenGLDisplayPlugin::getCompositeFBColorSpace() {
|
||||||
|
return gpu::Element::COLOR_RGBA_32;
|
||||||
|
}
|
||||||
|
|
||||||
void OpenGLDisplayPlugin::updateCompositeFramebuffer() {
|
void OpenGLDisplayPlugin::updateCompositeFramebuffer() {
|
||||||
auto renderSize = glm::uvec2(getRecommendedRenderSize());
|
auto renderSize = glm::uvec2(getRecommendedRenderSize());
|
||||||
if (!_compositeFramebuffer || _compositeFramebuffer->getSize() != renderSize) {
|
if (!_compositeFramebuffer || _compositeFramebuffer->getSize() != renderSize) {
|
||||||
_compositeFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create("OpenGLDisplayPlugin::composite", gpu::Element::COLOR_RGBA_32, renderSize.x, renderSize.y));
|
_compositeFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create("OpenGLDisplayPlugin::composite", getCompositeFBColorSpace(), renderSize.x, renderSize.y));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,9 @@ protected:
|
||||||
virtual std::function<void(gpu::Batch&, const gpu::TexturePointer&, bool mirror)> getHUDOperator();
|
virtual std::function<void(gpu::Batch&, const gpu::TexturePointer&, bool mirror)> getHUDOperator();
|
||||||
virtual void compositePointer();
|
virtual void compositePointer();
|
||||||
virtual void compositeExtra() {};
|
virtual void compositeExtra() {};
|
||||||
|
|
||||||
virtual gpu::PipelinePointer getCompositeScenePipeline();
|
virtual gpu::PipelinePointer getCompositeScenePipeline();
|
||||||
|
virtual gpu::Element getCompositeFBColorSpace();
|
||||||
|
|
||||||
// These functions must only be called on the presentation thread
|
// These functions must only be called on the presentation thread
|
||||||
virtual void customizeContext();
|
virtual void customizeContext();
|
||||||
|
@ -152,7 +154,9 @@ protected:
|
||||||
gpu::ShaderPointer _mirrorHUDPS;
|
gpu::ShaderPointer _mirrorHUDPS;
|
||||||
gpu::PipelinePointer _drawTexturePipeline;
|
gpu::PipelinePointer _drawTexturePipeline;
|
||||||
gpu::PipelinePointer _compositePipeline;
|
gpu::PipelinePointer _compositePipeline;
|
||||||
|
gpu::PipelinePointer _SRGBToLinearPipeline;
|
||||||
gpu::PipelinePointer _cursorPipeline;
|
gpu::PipelinePointer _cursorPipeline;
|
||||||
|
|
||||||
gpu::TexturePointer _displayTexture{};
|
gpu::TexturePointer _displayTexture{};
|
||||||
float _compositeHUDAlpha { 1.0f };
|
float _compositeHUDAlpha { 1.0f };
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue