Fix compositing mixing with framebuffer for web and ANGLE

This commit is contained in:
ubkp 2023-08-06 01:33:36 -03:00
parent dc621ca388
commit 6ac97d4ad9
3 changed files with 9 additions and 2 deletions

View File

@ -32,7 +32,7 @@
<style> <style>
body { margin: 0px; } body { margin: 0px; }
canvas.emscripten { border: 0px none; background-color: black; } canvas.emscripten { border: 0px none; }
</style> </style>
<script type='text/javascript' src="https://cdn.jsdelivr.net/gh/eligrey/FileSaver.js/dist/FileSaver.min.js"> </script> <script type='text/javascript' src="https://cdn.jsdelivr.net/gh/eligrey/FileSaver.js/dist/FileSaver.min.js"> </script>
<script type='text/javascript'> <script type='text/javascript'>

View File

@ -2890,6 +2890,14 @@ void rlDrawRenderBatch(rlRenderBatch *batch)
// Change to next buffer in the list (in case of multi-buffering) // Change to next buffer in the list (in case of multi-buffering)
batch->currentBuffer++; batch->currentBuffer++;
if (batch->currentBuffer >= batch->bufferCount) batch->currentBuffer = 0; if (batch->currentBuffer >= batch->bufferCount) batch->currentBuffer = 0;
#if defined(GRAPHICS_API_OPENGL_ES2)
// Fix compositing mixing with the framebuffer (that causes transparency issues) by clearing the alpha channel on the end of the frame
glClearColor(0, 0, 0, 1);
glColorMask(false, false, false, true);
glClear(GL_COLOR_BUFFER_BIT);
glColorMask(true, true, true, true);
#endif
#endif #endif
} }

View File

@ -75,7 +75,6 @@ jwE50AGjLCVuS8Yt4H7OgZLKK5EKOsLviEWJSL/+0uMi7gLUSBseYwqEbXvSHCec1CJvZPyHCmYQffaB
/* NOTE: Canvas *must not* have any border or padding, or mouse coords will be wrong */ /* NOTE: Canvas *must not* have any border or padding, or mouse coords will be wrong */
canvas.emscripten { canvas.emscripten {
border: 0px none; border: 0px none;
background: black;
width: 100%; width: 100%;
} }