diff --git a/src/GLWpfControl/DxGLFramebuffer.cs b/src/GLWpfControl/DxGLFramebuffer.cs index 111aec1..eb4e02a 100644 --- a/src/GLWpfControl/DxGLFramebuffer.cs +++ b/src/GLWpfControl/DxGLFramebuffer.cs @@ -97,12 +97,18 @@ public DxGLFramebuffer([NotNull] DxGlContext context, int width, int height, dou GLDepthRenderBufferHandle = GL.GenRenderbuffer(); GL.BindRenderbuffer(RenderbufferTarget.Renderbuffer, GLDepthRenderBufferHandle); - GL.RenderbufferStorage(RenderbufferTarget.Renderbuffer, RenderbufferStorage.DepthComponent24, FramebufferWidth, FramebufferHeight); + GL.RenderbufferStorage(RenderbufferTarget.Renderbuffer, RenderbufferStorage.Depth24Stencil8, FramebufferWidth, FramebufferHeight); + GL.FramebufferRenderbuffer( FramebufferTarget.Framebuffer, FramebufferAttachment.DepthAttachment, RenderbufferTarget.Renderbuffer, GLDepthRenderBufferHandle); + GL.FramebufferRenderbuffer( + FramebufferTarget.Framebuffer, + FramebufferAttachment.StencilAttachment, + RenderbufferTarget.Renderbuffer, + GLDepthRenderBufferHandle); GL.BindFramebuffer(FramebufferTarget.Framebuffer, 0);