From a0cb576950b32b57fc99de8ffc49342991d9ed87 Mon Sep 17 00:00:00 2001 From: Lubos Date: Sun, 1 May 2022 18:17:27 +0200 Subject: [PATCH] Clearing alpha channel of FBO fixes a few menu issues --- android/app/src/main/cpp/code/vr/vr_renderer.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/android/app/src/main/cpp/code/vr/vr_renderer.c b/android/app/src/main/cpp/code/vr/vr_renderer.c index d00235a7..eaadd43c 100644 --- a/android/app/src/main/cpp/code/vr/vr_renderer.c +++ b/android/app/src/main/cpp/code/vr/vr_renderer.c @@ -345,6 +345,12 @@ void VR_DrawFrame( engine_t* engine ) { Com_Frame(); + // Clear the alpha channel, other way VR API would not transfer the framebuffer fully + glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE); + glClearColor(0.0, 0.0, 0.0, 1.0); + glClear(GL_COLOR_BUFFER_BIT); + glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); + engine->framebuffers.swapchainIndex = (engine->framebuffers.swapchainIndex + 1) % engine->framebuffers.swapchainLength;