From d4f18c6478a2ad0bffbaa281732e5ee979626ab7 Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Sun, 10 Aug 2025 18:33:56 +0100 Subject: [PATCH 1/3] Ask for zero alpha bits for the CS This *might* fix https://gitlab.com/OpenMW/openmw/-/issues/8270, but I couldn't repro it. When I debugged it, the default value was 0xFFFFFFFF, which hopefully is a magic *don't care* value and asking for zero gives us exactly zero rather than at least zero. However, it might just mean *as much as possible*, in which case zero might still mean *at least zero* and sometimes end up not being zero. --- apps/opencs/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/opencs/main.cpp b/apps/opencs/main.cpp index f2e2156865..c7c35a192d 100644 --- a/apps/opencs/main.cpp +++ b/apps/opencs/main.cpp @@ -35,6 +35,7 @@ void setQSurfaceFormat() format.setSamples(ds->getMultiSamples()); format.setStencilBufferSize(ds->getMinimumNumStencilBits()); format.setSwapBehavior(QSurfaceFormat::DoubleBuffer); + format.setAlphaBufferSize(0); QSurfaceFormat::setDefaultFormat(format); } From bd685d672d3d996464f6b8c77b01d864cf9b13a6 Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Tue, 9 Dec 2025 17:25:59 +0000 Subject: [PATCH 2/3] Set RTT FBO format, too. --- apps/opencs/main.cpp | 2 +- apps/opencs/view/render/scenewidget.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/opencs/main.cpp b/apps/opencs/main.cpp index c7c35a192d..844a7895e8 100644 --- a/apps/opencs/main.cpp +++ b/apps/opencs/main.cpp @@ -35,7 +35,7 @@ void setQSurfaceFormat() format.setSamples(ds->getMultiSamples()); format.setStencilBufferSize(ds->getMinimumNumStencilBits()); format.setSwapBehavior(QSurfaceFormat::DoubleBuffer); - format.setAlphaBufferSize(0); + format.setAlphaBufferSize(ds->getMinimumNumAlphaBits()); QSurfaceFormat::setDefaultFormat(format); } diff --git a/apps/opencs/view/render/scenewidget.cpp b/apps/opencs/view/render/scenewidget.cpp index 5e8db03cf8..edb75cbd25 100644 --- a/apps/opencs/view/render/scenewidget.cpp +++ b/apps/opencs/view/render/scenewidget.cpp @@ -72,6 +72,11 @@ namespace CSVRender mWidget = new osgQOpenGLWidget(this); + // not the most idiomatic place to do this, but osgQt needs its guts rearranging to do things properly + // we *should* be setting this on the default osg::DisplaySettings instance (or relying on the fact that we want the default) or the View's instance + // then osgQt should, but doesn't, use that to create a GraphicsTraits instance, and propagate the details from that to Qt for us + mWidget->setTextureFormat(GL_RGB8); + mRenderer = mWidget->getCompositeViewer(); osg::ref_ptr window = new osgViewer::GraphicsWindowEmbedded(0, 0, width(), height()); From e91f5a5b0a1e2fb28af6806c96ce039982390cd5 Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Tue, 9 Dec 2025 17:32:22 +0000 Subject: [PATCH 3/3] Reformat comment to appease fascist Clang tool --- apps/opencs/view/render/scenewidget.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/opencs/view/render/scenewidget.cpp b/apps/opencs/view/render/scenewidget.cpp index edb75cbd25..3a8a22a50f 100644 --- a/apps/opencs/view/render/scenewidget.cpp +++ b/apps/opencs/view/render/scenewidget.cpp @@ -72,9 +72,11 @@ namespace CSVRender mWidget = new osgQOpenGLWidget(this); - // not the most idiomatic place to do this, but osgQt needs its guts rearranging to do things properly - // we *should* be setting this on the default osg::DisplaySettings instance (or relying on the fact that we want the default) or the View's instance - // then osgQt should, but doesn't, use that to create a GraphicsTraits instance, and propagate the details from that to Qt for us + // Not the most idiomatic place to do this, but osgQt needs its guts rearranging to do things properly. + // We *should* be setting this (or relying on the fact that we want the default value) on the default + // osg::DisplaySettings instance or the View's instance. + // Then osgQt should, but doesn't, use that to create a GraphicsTraits instance, and propagate the details from + // that to Qt for us. mWidget->setTextureFormat(GL_RGB8); mRenderer = mWidget->getCompositeViewer();