mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 12:49:34 +02:00
fix the bug with sahdows on Mac due to the fbo needing a colorbuffer even though it's not needed
This commit is contained in:
parent
dc9e5cad24
commit
6da796f735
1 changed files with 13 additions and 0 deletions
|
@ -74,6 +74,19 @@ GLBackend::GLFramebuffer* GLBackend::syncGPUObject(const Framebuffer& framebuffe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if (GPU_FEATURE_PROFILE == GPU_LEGACY)
|
||||||
|
// for reasons that i don;t understand yet, it seems that on mac gl, a fbo must have a color buffer...
|
||||||
|
else {
|
||||||
|
GLuint renderBuffer = 0;
|
||||||
|
glGenRenderbuffers(1, &renderBuffer);
|
||||||
|
glBindRenderbuffer(GL_RENDERBUFFER, renderBuffer);
|
||||||
|
glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA, framebuffer.getWidth(), framebuffer.getHeight());
|
||||||
|
glBindRenderbuffer(GL_RENDERBUFFER, 0);
|
||||||
|
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, renderBuffer);
|
||||||
|
CHECK_GL_ERROR();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
if (framebuffer.hasDepthStencil()) {
|
if (framebuffer.hasDepthStencil()) {
|
||||||
auto surface = framebuffer.getDepthStencilBuffer();
|
auto surface = framebuffer.getDepthStencilBuffer();
|
||||||
|
|
Loading…
Reference in a new issue