mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
works on desktop, android mobile, rift and quest
This commit is contained in:
parent
17163a1ce8
commit
8c3ddc049c
6 changed files with 7 additions and 27 deletions
|
@ -123,23 +123,6 @@ gpu::PipelinePointer Basic2DWindowOpenGLDisplayPlugin::getRenderTexturePipeline(
|
|||
#endif
|
||||
}
|
||||
|
||||
gpu::PipelinePointer Basic2DWindowOpenGLDisplayPlugin::getCompositeScenePipeline() {
|
||||
#if defined(Q_OS_ANDROID)
|
||||
return _linearToSRGBPipeline;
|
||||
#else
|
||||
return _drawTexturePipeline;
|
||||
#endif
|
||||
}
|
||||
|
||||
gpu::Element Basic2DWindowOpenGLDisplayPlugin::getCompositeFBColorSpace() {
|
||||
#if defined(Q_OS_ANDROID)
|
||||
return gpu::Element::COLOR_SRGBA_32;
|
||||
#else
|
||||
return gpu::Element::COLOR_RGBA_32;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void Basic2DWindowOpenGLDisplayPlugin::compositeExtra() {
|
||||
#if defined(Q_OS_ANDROID)
|
||||
auto& virtualPadManager = VirtualPad::Manager::instance();
|
||||
|
|
|
@ -38,8 +38,6 @@ public:
|
|||
virtual void pluginUpdate() override {};
|
||||
|
||||
virtual gpu::PipelinePointer getRenderTexturePipeline() override;
|
||||
virtual gpu::PipelinePointer getCompositeScenePipeline() override;
|
||||
virtual gpu::Element getCompositeFBColorSpace() override;
|
||||
|
||||
protected:
|
||||
mutable bool _isThrottled = false;
|
||||
|
|
|
@ -905,7 +905,7 @@ OpenGLDisplayPlugin::~OpenGLDisplayPlugin() {
|
|||
void OpenGLDisplayPlugin::updateCompositeFramebuffer() {
|
||||
auto renderSize = glm::uvec2(getRecommendedRenderSize());
|
||||
if (!_compositeFramebuffer || _compositeFramebuffer->getSize() != renderSize) {
|
||||
_compositeFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create("OpenGLDisplayPlugin::composite", getCompositeFBColorSpace(), renderSize.x, renderSize.y));
|
||||
_compositeFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create("OpenGLDisplayPlugin::composite", gpu::Element::COLOR_RGBA_32, renderSize.x, renderSize.y));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -968,9 +968,3 @@ gpu::PipelinePointer OpenGLDisplayPlugin::getCompositeScenePipeline() {
|
|||
return _drawTexturePipeline;
|
||||
}
|
||||
|
||||
// Added this to allow desktop composite framebuffer to be RGBA while mobile is SRGBA, so that tone mapping looks right on both platforms
|
||||
// Overridden by Basic2DWindowDisplayPlugin to achieve this
|
||||
// FIXME: Eventually it would be ideal to have both framebuffers be of the same type
|
||||
gpu::Element OpenGLDisplayPlugin::getCompositeFBColorSpace() {
|
||||
return gpu::Element::COLOR_RGBA_32;
|
||||
}
|
||||
|
|
|
@ -163,7 +163,6 @@ protected:
|
|||
|
||||
virtual gpu::PipelinePointer getRenderTexturePipeline();
|
||||
virtual gpu::PipelinePointer getCompositeScenePipeline();
|
||||
virtual gpu::Element getCompositeFBColorSpace();
|
||||
|
||||
struct CursorData {
|
||||
QImage image;
|
||||
|
|
|
@ -124,6 +124,11 @@ void OculusDisplayPlugin::uncustomizeContext() {
|
|||
Parent::uncustomizeContext();
|
||||
}
|
||||
|
||||
gpu::PipelinePointer OculusDisplayPlugin::getRenderTexturePipeline() {
|
||||
//return _SRGBToLinearPipeline;
|
||||
return _drawTexturePipeline;
|
||||
}
|
||||
|
||||
gpu::PipelinePointer OculusDisplayPlugin::getCompositeScenePipeline() {
|
||||
return _SRGBToLinearPipeline;
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ public:
|
|||
|
||||
virtual QJsonObject getHardwareStats() const;
|
||||
|
||||
virtual gpu::PipelinePointer getRenderTexturePipeline() override;
|
||||
virtual gpu::PipelinePointer getCompositeScenePipeline() override;
|
||||
|
||||
protected:
|
||||
|
|
Loading…
Reference in a new issue